Initial Commit

This commit is contained in:
June
2026-03-24 22:00:03 -07:00
parent bf9620bbb6
commit 5533b95cff
73 changed files with 1647 additions and 293 deletions

View File

@@ -1,42 +1,42 @@
extends Node
enum playerState {
eState_Menu,
eState_Office,
eState_Camera,
eState_Dead
}
enum LocationID {
POWER_STATION=0,
DINING_AREA=1,
WEST_HALL=2,
EAST_HALL=3,
SUPPLY_CLOSET=4,
BACKSTAGE=5,
LIVING_AREA=6,
OFFICE_LEFT_DOOR=7,
OFFICE_RIGHT_DOOR=8,
OFFICE=9
}
var LocationGraph := {
LocationID.POWER_STATION: [LocationID.DINING_AREA],
LocationID.WEST_HALL: [LocationID.OFFICE_LEFT_DOOR],
LocationID.EAST_HALL: [LocationID.OFFICE_RIGHT_DOOR],
LocationID.OFFICE_LEFT_DOOR: [],
LocationID.OFFICE_RIGHT_DOOR: []
}
var gameNight = 0
var stars = 0
var nightStarted: bool = false
var nightCompleted: bool = false
var currentPlayerState: playerState = playerState.eState_Menu
var cameras
var locations
var cameraHelper
var game
func _ready() -> void:
nightStarted = true
cameras = loadJSON("res://Data/cameras.json")
locations = loadJSON("res://Data/locations.json")
cameraHelper = hCamera.new()
cameraHelper.setup(cameras)
game = cGame.new()
begin_game()
func begin_game():
game._setup()
game.nightStarted = true
func loadJSON(path: String) -> Dictionary:
var file = FileAccess.open(path, FileAccess.READ)
if not file:
push_error("Failed to open JSON: %s" % path)
return {}
var text = file.get_as_text()
file.close()
var data = JSON.parse_string(text)
if typeof(data) != TYPE_DICTIONARY:
push_error("JSON did not return a dictionary: %s" % path)
return {}
return data
func _input(event: InputEvent) -> void:
if event is InputEventKey: