initial transfer of old game

This commit is contained in:
Jaap Marsman 2022-11-09 20:09:17 +08:00
parent 008ffb68df
commit d1a619735a
73 changed files with 3544 additions and 0 deletions

11
godot/AllBuildings.tscn Normal file
View File

@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Assets/classroom_empty.png" type="Texture" id=1]
[node name="AllBuildings" type="Node"]
[node name="Classroom" type="Node2D" parent="."]
[node name="classroom_empty" type="Sprite" parent="Classroom"]
position = Vector2( 152.713, 124.123 )
texture = ExtResource( 1 )

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,6 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://Assets/Xolonium-Regular.ttf" type="DynamicFontData" id=1]
[resource]
font_data = ExtResource( 1 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/classroom_empty.png-c01200954255d576e059ca479e9e2498.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/classroom_empty.png"
dest_files=[ "res://.import/classroom_empty.png-c01200954255d576e059ca479e9e2498.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
godot/Assets/grass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/grass.png-46bb554aade75a091da98570239d1507.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/grass.png"
dest_files=[ "res://.import/grass.png-46bb554aade75a091da98570239d1507.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
godot/Assets/road.aseprite Normal file

Binary file not shown.

BIN
godot/Assets/road.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/road.png-c3c47e2cc8c90beae2ad5c8a3bb2c3ca.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/road.png"
dest_files=[ "res://.import/road.png-c3c47e2cc8c90beae2ad5c8a3bb2c3ca.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
godot/Assets/road2.aseprite Normal file

Binary file not shown.

BIN
godot/Assets/road2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/road2.png-3f6afbaa996079cb42c78e4d1e7670f5.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/road2.png"
dest_files=[ "res://.import/road2.png-3f6afbaa996079cb42c78e4d1e7670f5.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/road_crossing.png-13290d5fe14068f060bacc8e668e68a5.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/road_crossing.png"
dest_files=[ "res://.import/road_crossing.png-13290d5fe14068f060bacc8e668e68a5.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
godot/Assets/tree1.aseprite Normal file

Binary file not shown.

BIN
godot/Assets/tree1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tree1.png-bee06456232c1c7e7aa2f9c68bba732a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/tree1.png"
dest_files=[ "res://.import/tree1.png-bee06456232c1c7e7aa2f9c68bba732a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

19
godot/BudgetMenu.gd Normal file
View File

@ -0,0 +1,19 @@
extends Control
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
onready var finances = get_node("/root/Finances")
var estimate_month
# Called when the node enters the scene tree for the first time.
func _ready():
game_time.connect("heartbeat", self, "_on_heartbeat")
func _on_heartbeat():
estimate_month = player_vars.pupils_income - player_vars.operating_costs - player_vars.salary_cost
$BuildingCostNumber.text = str(player_vars.operating_costs)
$TeacherCostNumber.text = str(player_vars.salary_cost)
$PupilIncomeNumber.text = str(player_vars.pupils_income)
$TotalNumber.text = str(estimate_month)

42
godot/Buildings.gd Normal file
View File

@ -0,0 +1,42 @@
extends Node
onready var player_vars = get_node("/root/PlayerVariables")
var classroom_agent = preload("res://Rooms/Classroom.tscn")
var staffroom_agent = preload("res://Rooms/StaffRoom.tscn")
var cpdroom_agent = preload("res://Rooms/CPDRoom.tscn")
# Repeatable Buildings
func add_classroom():
if player_vars.funds > (player_vars.classroom_cost - 1):
var classroom = classroom_agent.instance()
add_child(classroom)
player_vars.funds -= player_vars.classroom_cost
player_vars.classroom_count += 1
func add_staffroom():
if player_vars.has_staffroom == false:
if player_vars.funds > (player_vars.staffroom_cost - 1):
var staffroom = staffroom_agent.instance()
add_child(staffroom)
player_vars.funds -= player_vars.staffroom_cost
player_vars.has_staffroom = true
# Unique Buildings
func add_cpdroom():
if player_vars.has_cpdroom == false:
if player_vars.funds > (player_vars.cpdroom_cost - 1):
var cpdroom = cpdroom_agent.instance()
add_child(cpdroom)
player_vars.funds -= player_vars.cpdroom_cost
player_vars.has_cpdroom = true
func _on_ClassroomButton_pressed():
add_classroom()
func _on_StaffroomButton_pressed():
add_staffroom()
func _on_CPDRoomButton_pressed():
add_cpdroom()

50
godot/CTeacher.gd Normal file
View File

@ -0,0 +1,50 @@
extends Node2D
onready var game_time = get_node("/root/GameTimer")
onready var player_vars = get_node("/root/PlayerVariables")
onready var teacher_manager = get_node("/root/Main/ClassTeachers")
onready var name_gen = get_node("/root/NameGenerator")
onready var registers = get_node("/root/Registers")
var teacher_happiness : int
var teacher_academic_rating : int
var teacher_report_card : int
var teacher_gender : bool
var teacher_name : String
var teacher_first_name : String
var teacher_last_name : String
var teacher_in_game : int
var teacher_joined_this_season : bool
var teacher_id : int
func _ready():
randomize()
game_time.connect("heartbeat", self, "teacher_on_heartbeat")
game_time.connect("month_heartbeat", self, "teacher_on_month_heartbeat")
teacher_joined_this_season = true
player_vars.teacher_baseid += 1
teacher_gender = (randi() & 1)
teacher_last_name = name_gen.last_name[randi() % name_gen.last_name.size()]
if teacher_gender == true:
teacher_first_name = name_gen.boy_first_name[randi() % name_gen.boy_first_name.size()]
if teacher_gender == false:
teacher_first_name = name_gen.girl_first_name[randi() % name_gen.girl_first_name.size()]
teacher_id = player_vars.teacher_baseid
teacher_name = teacher_first_name + " " + teacher_last_name
registers.TeacherRegister.append(teacher_name)
func teacher_on_heartbeat():
teacher_in_game += 1
player_vars.salary_cost += (player_vars.cteacher_salary / 20)
# StaffTracker stuff
teacher_manager.sa_pool += 1
teacher_manager.se_pool += 1
teacher_manager.sw_pool += 1
if teacher_in_game == 60:
teacher_joined_this_season = false
func teacher_on_month_heartbeat():
pass

6
godot/CTeacher.tscn Normal file
View File

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://CTeacher.gd" type="Script" id=1]
[node name="CTeacher" type="Node2D"]
script = ExtResource( 1 )

50
godot/ClassTeachers.gd Normal file
View File

@ -0,0 +1,50 @@
extends Node
onready var player_vars = get_node("/root/PlayerVariables")
var classroomteacher = preload("res://CTeacher.tscn")
onready var game_time = get_node("/root/GameTimer")
var staff_tracker_achievement : int
var sa_pool : int
var staff_tracker_enjoyment : int
var se_pool : int
var staff_tracker_wellbeing : int
var sw_pool : int
var staff_tracker_total : int
# Called when the node enters the scene tree for the first time.
func _ready():
game_time.connect("heartbeat", self, "on_heartbeat")
staff_tracker_achievement = 50
staff_tracker_enjoyment = 50
staff_tracker_wellbeing = 50
staff_tracker_total = 50
# game_time.connect("month_heartbeat", self, "on_month_heartbeat")
func add_teacher():
if player_vars.teacher_pop < player_vars.classroom_count:
if player_vars.funds > (player_vars.teacher_hire - 1):
var teacher_agent = classroomteacher.instance()
add_child(teacher_agent)
player_vars.funds -= player_vars.teacher_hire
player_vars.teacher_pop += 1
func _on_AddTeacher_pressed():
add_teacher()
func on_heartbeat():
player_vars.teacher_pop = get_child_count()
staff_tracker()
func staff_tracker():
if sa_pool > 0 && staff_tracker_achievement < 100:
staff_tracker_achievement += (sa_pool / player_vars.teacher_pop)
if se_pool > 0 && staff_tracker_enjoyment < 100:
staff_tracker_enjoyment += (se_pool / player_vars.teacher_pop)
if sw_pool > 0 && staff_tracker_wellbeing < 100:
staff_tracker_wellbeing += (sw_pool / player_vars.teacher_pop)
sa_pool = 0
sw_pool = 0
se_pool = 0
staff_tracker_total = int(float(staff_tracker_achievement * 0.5 + staff_tracker_enjoyment * 0.2 + staff_tracker_wellbeing * 0.3))

22
godot/DebugMenu.gd Normal file
View File

@ -0,0 +1,22 @@
extends Control
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
func _ready():
game_time.connect("heartbeat", self, "_on_heartbeat")
func _on_heartbeat():
$PupilsLabel.text = str(player_vars.pupil_pop)
$TeacherLabel.text = str(player_vars.teacher_pop)
$ClassroomLabel.text = str(player_vars.classroom_count)
if player_vars.has_cpdroom == true:
$CPDRoomLabel.text = str("HasCPDRoom")
func _on_AddMoney_pressed():
player_vars.funds += 100000
func _on_StaffroomButton_pressed():
if player_vars.has_staffroom == true:
$StaffroomLabel.text = str("HasStaffroom")

13
godot/Dialogs.gd Normal file
View File

@ -0,0 +1,13 @@
extends Node
onready var game_time = get_node("/root/GameTimer")
onready var josephine1_dialog = get_node("/root/Main/UI/Dialogs/Josephine1")
func _ready():
game_time.connect("josephine_dialog1", self, "_on_josephine_dialog1")
pass
func _on_josephine_dialog1():
# game_time.paused = 1
josephine1_dialog.talk()
# game_time.paused = 0

View File

@ -0,0 +1,45 @@
extends Node
var dialogue_state : int
onready var dialoguePopup = $"../../DialoguePopup"
onready var buttona = $"../../DialoguePopup/DialogBox/ButtonA"
onready var buttonb = $"../../DialoguePopup/DialogBox/ButtonB"
# Called when the node enters the scene tree for the first time.
func _ready():
dialogue_state = 0
func talk(answer = ""):
dialoguePopup.npc = self
dialoguePopup.npc_name = "Josephine"
match dialogue_state:
0:
dialogue_state = 1
dialoguePopup.dialogue = "Hello you! This is a test!"
dialoguePopup.answera = "Understood."
dialoguePopup.answerb = "Tell me more."
dialoguePopup.open()
1:
match answer:
"A":
dialogue_state = 3
dialoguePopup.dialogue = "Well. There's a lot to cover. Bye!"
dialoguePopup.answera = "End"
buttonb.visible = false
dialoguePopup.open()
"B":
dialogue_state = 3
dialoguePopup.dialogue = "I'd rather not..."
dialoguePopup.answera = "End"
buttonb.visible = false
dialoguePopup.open()
2:
dialogue_state = 3
dialoguePopup.answera = "End"
buttonb.visible = false
# dialoguePopup.open()
3:
dialogue_state = 0
dialoguePopup.close()

View File

@ -0,0 +1,3 @@
{
"001" : {"name":"Josephine", "expression": "neutral", "text":"You found something." },
}

70
godot/DialoguePopup.gd Normal file
View File

@ -0,0 +1,70 @@
extends Popup
onready var game_time = get_node("/root/GameTimer")
var npc_name setget name_set
var dialogue setget dialogue_set
var answers setget answers_set
var npc
var answera setget answera_set
var answerb setget answerb_set
func name_set(new_value):
npc_name = new_value
$DialogBox/NameBox/NPCName.text = new_value
func dialogue_set(new_value):
dialogue = new_value
$DialogBox/Dialogue.text = new_value
func answers_set(new_value):
answers = new_value
$DialogBox/Answers.text = new_value
func answera_set(new_value):
answera = new_value
$DialogBox/ButtonA.text = new_value
func answerb_set(new_value):
answerb = new_value
$DialogBox/ButtonB.text = new_value
func open():
set_process_input(true)
game_time.paused = 1
popup()
$DialogBox/Tween.interpolate_property(
$DialogBox/Dialogue, "percent_visible", 0, 1, 1,
Tween.TRANS_LINEAR,Tween.EASE_IN_OUT
)
$DialogBox/Tween.start()
func close():
set_process_input(false)
hide()
game_time.paused = 0
func _ready():
set_process_input(false)
func _input(event):
if event is InputEventKey:
if event.scancode == KEY_A:
# if _on_ButtonA_pressed():
set_process_input(false)
npc.talk("A")
elif event.scancode == KEY_B:
set_process_input(false)
npc.talk("B")
func _on_ButtonA_pressed():
var a = InputEventKey.new()
a.scancode = KEY_A
a.pressed = true # change to false to simulate a key release
Input.parse_input_event(a)
func _on_ButtonB_pressed():
var a = InputEventKey.new()
a.scancode = KEY_B
a.pressed = true # change to false to simulate a key release
Input.parse_input_event(a)

3
godot/Docs/3d_idea.md Normal file
View File

@ -0,0 +1,3 @@
Use BlockBench:
[Blockbench](https://www.blockbench.net)

42
godot/Docs/SchoolSim.md Normal file
View File

@ -0,0 +1,42 @@
StudentTracker
A value between 0 and 100 (percentage, 50 is neutral)
Comprises of
- Achievement (50%)
- Enjoyment (20%)
- Wellbeing (30%)
StaffTracker
- Quality of Teaching (50 %)
- Wellbeing (30 %)
- Enjoyment (20 %)
ParentTracker
- Satisfaction
Every value is 0 to 100
But then the average is as described above.
This influences:
- School Rating
It would be great if there were different buildings available depending on the type of school you wanted to create.
- Secondary School will be a 1.1 update. Or 1.2 or 1.3. Or 1.4. We'll start with just Primary.
So the type of Primary School you can build... needs to be unlocked through research, I think. The types are:
- International School (Pupil Fee difference. Classroom size difference.)
- Local School
- Natural School (low tech)
Someday/Maybe features:
- Landscape editors
- Slopes (like Transport Tycoon). I think it can be done, using simple logic statements. Things that can / can't be built on slopes. And would add interesting visual features to the school design. A hallway block placed on a slope would automatically become a staircase. And can't link to anything else. It stairways depending on the slope.
- Multi-story. This just seems incredibly complex.
- Moving agents. Similar to actual simulator-movement. Would be incredibly difficult to implement. I'd rather go for the random animation player and not bother with visible agents. Though assigning teachers to classrooms is a must.

31
godot/Finances.gd Normal file
View File

@ -0,0 +1,31 @@
extends Node
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
# Called when the node enters the scene tree for the first time.
func _ready():
# game_time.connect("heartbeat", self, "_on_heartbeat")
game_time.connect("month_heartbeat", self, "_on_month_heartbeat")
# game_time.connect("season_heartbeat", self, "_on_season_heartbeat")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
#func _on_heartbeat():
# pass
func _on_month_heartbeat():
player_vars.funds += player_vars.pupils_income
player_vars.funds -= player_vars.salary_cost
player_vars.funds -= player_vars.operating_costs
player_vars.salary_cost = 0
player_vars.pupils_income = 0
player_vars.operating_costs = 0
#func _on_season_heartbeat():
# pass

60
godot/GameTimer.gd Normal file
View File

@ -0,0 +1,60 @@
extends Node
onready var player_vars = get_node("/root/PlayerVariables")
var game_timer = 0
var wait_time = 6
var paused = 0
signal heartbeat
signal week_heartbeat
signal month_heartbeat
signal season_heartbeat
signal year_heartbeat
# Dialogues
signal josephine_dialog1
# Called when the node enters the scene tree for the first time.
func _ready():
# warning-ignore:return_value_discarded
connect("heartbeat", self, "on_heartbeat")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
game_timer += delta
if game_timer > wait_time:
if paused == 0:
game_timer = 0
emit_signal("heartbeat")
if paused == 1:
game_timer = 0
func on_heartbeat():
player_vars.day += 1
player_vars.total_day += 1
if player_vars.day == 6:
player_vars.day = 1
player_vars.week += 1
emit_signal("week_heartbeat")
if player_vars.week == 5:
player_vars.week = 1
player_vars.month += 1
emit_signal("month_heartbeat")
if player_vars.month == 3:
player_vars.month = 1
player_vars.season += 1
emit_signal("season_heartbeat")
if player_vars.season == 6:
player_vars.season = 1
player_vars.year += 1
emit_signal("year_heartbeat")
# Unique Day Events
if player_vars.total_day == 2:
emit_signal("josephine_dialog1")

10
godot/Main.gd Normal file
View File

@ -0,0 +1,10 @@
extends Node
onready var player_vars = get_node("/root/PlayerVariables")
# Called when the node enters the scene tree for the first time.
#func _ready():
# pass
#func _process(delta):
# pass

1801
godot/Main.tscn Normal file

File diff suppressed because one or more lines are too long

41
godot/MainCamera.gd Normal file
View File

@ -0,0 +1,41 @@
extends Camera2D
const MAX_ZOOM_LEVEL = 0.5
const MIN_ZOOM_LEVEL = 2.5
const ZOOM_INCREMENT = 0.5
signal moved()
signal zoomed()
var _current_zoom_level = 1.5
var _drag = false
func _input(event):
if event.is_action_pressed("cam_drag"):
_drag = true
elif event.is_action_released("cam_drag"):
_drag = false
elif event.is_action("cam_zoom_in"):
_update_zoom(-ZOOM_INCREMENT, get_local_mouse_position())
elif event.is_action("cam_zoom_out"):
_update_zoom(ZOOM_INCREMENT, get_local_mouse_position())
elif event is InputEventMouseMotion && _drag:
set_offset(get_offset() - event.relative*_current_zoom_level)
emit_signal("moved")
func _update_zoom(incr, zoom_anchor):
var old_zoom = _current_zoom_level
_current_zoom_level += incr
if _current_zoom_level < MAX_ZOOM_LEVEL:
_current_zoom_level = MAX_ZOOM_LEVEL
elif _current_zoom_level > MIN_ZOOM_LEVEL:
_current_zoom_level = MIN_ZOOM_LEVEL
if old_zoom == _current_zoom_level:
return
var zoom_center = zoom_anchor - get_offset()
var ratio = 1-_current_zoom_level/old_zoom
set_offset(get_offset() + zoom_center*ratio)
set_zoom(Vector2(_current_zoom_level, _current_zoom_level))
emit_signal("zoomed")

7
godot/NameGenerator.gd Normal file
View File

@ -0,0 +1,7 @@
extends Node
const boy_first_name = ["Adam", "Ben", "Cody", "David", "Ephraim", "Fred", "Greg", "Harry", "Ian", "John", "Kenny", "Leo", "Manfred", "Nico", "Oliver", "Paddy", "Quentin", "Robert", "Stephen", "Theo", "Uman", "Victor", "Wanford", "Xavier", "Ystan", "Zebedeus"]
const girl_first_name = ["Mandy"]
const last_name = ["Johnson", "Abrahms", "Stevens"]

108
godot/PlayerVariables.gd Normal file
View File

@ -0,0 +1,108 @@
extends Node
# Time Variables
var day : int
var week : int
var month : int
var season : int
var year : int
var total_day : int
# Finance Variables
var funds : int
var pupil_funding : float
var pupils_income : float
var operating_costs : float
var land_lease : int
var cteacher_salary : float
var salary_cost : float
# Population Variables
var pupil_pop : int
var max_pupils : int
var pupil_baseid : int
var teacher_baseid : int
var total_pupils_in_game : int
var total_pupils_in_school : int
var teacher_pop : int
var pupil_difference : int
# Rating Variables
var school_level : int
var rating : float
# Building Variables
var classroom_count : int
# Game Management Variables
var loaded_game : bool
# Policy Variables
var pupils_per_classroom : int
var pupil_fee : float
# Principal Variables
var principal_name : String
# School Variables
var school_name : String
# Building & Staffing Costs
var classroom_cost : int
var cpdroom_cost : int
var staffroom_cost : int
var teacher_hire : int
var classroom_operating : float
var cpdroom_operating : float
var staffroom_operating : float
# Unique Buildings
var has_staffroom : bool
var has_cpdroom : bool
# Called when the node enters the scene tree for the first time.
func _ready():
# Setting things up for a new game (Easy difficulty)
if loaded_game == false:
# Initial Timer Stuff
loaded_game = true
day = 1
week = 1
month = 1
season = 1
year = 1
total_day = 1
pupil_fee = 0
pupil_funding = 200.00
funds = 20000
cteacher_salary = 2000.00
pupils_per_classroom = 20
rating = 1.0
principal_name = "Joe Bloggs"
school_level = 1
pupil_baseid = 0
teacher_pop = 0
teacher_hire = 2000
# Building Costs
classroom_cost = 7500
staffroom_cost = 5000
cpdroom_cost = 12500
# Operating Costs
classroom_operating = 1600.00
cpdroom_operating = 1500.00
staffroom_operating = 1000.00
has_cpdroom = false
has_staffroom = false

BIN
godot/Principal/Face1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Face1.png-b7a4b8ed2752953c1379d3eb5487f396.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Principal/Face1.png"
dest_files=[ "res://.import/Face1.png-b7a4b8ed2752953c1379d3eb5487f396.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
godot/Principal/Face2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Face2.png-e55ff0cefe3d5f37d9e69776ba18b206.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Principal/Face2.png"
dest_files=[ "res://.import/Face2.png-e55ff0cefe3d5f37d9e69776ba18b206.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
godot/Principal/Face3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Face3.png-23410e5ad82018561c3c2c91bb6b3750.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Principal/Face3.png"
dest_files=[ "res://.import/Face3.png-23410e5ad82018561c3c2c91bb6b3750.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

45
godot/PrincipalMenu.gd Normal file
View File

@ -0,0 +1,45 @@
extends Control
onready var player_vars = get_node("/root/PlayerVariables")
var principal_face1 = preload("res://Principal/Face1.png")
var principal_face2 = preload("res://Principal/Face2.png")
var principal_face3 = preload("res://Principal/Face3.png")
var principal_num = 1
var principal_num_max = 4
onready var principal_face = get_node("PrincipalPhoto")
func switch_principal_face():
if principal_num == 1:
principal_face.set_texture(principal_face1)
if principal_num == 2:
principal_face.set_texture(principal_face2)
if principal_num == 3:
principal_face.set_texture(principal_face3)
func _on_ChangeFace_pressed():
if principal_num < principal_num_max:
principal_num += 1
if principal_num == principal_num_max:
principal_num = 1
$PrincipalNumLabel.text = str(principal_num)
switch_principal_face()
# Called when the node enters the scene tree for the first time.
func _ready():
$PrincipalNumLabel.text = str(principal_num)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_SchoolNameOK_pressed():
player_vars.school_name = $SchoolNameLine.text

146
godot/Pupil.gd Normal file
View File

@ -0,0 +1,146 @@
extends Node
onready var game_time = get_node("/root/GameTimer")
onready var player_vars = get_node("/root/PlayerVariables")
onready var name_gen = get_node("/root/NameGenerator")
onready var registers = get_node("/root/Registers")
onready var pupil_manager = get_node("/root/Main/Pupils")
var pupil_neg_chance : int
var pupil_id : int
var pupil_first_name : String
var pupil_last_name : String
var pupil_full_name : String
var pupil_gender : bool
var pupil_achievement : int
var pupil_enjoyment : int
var pupil_wellbeing : int
var pupil_report_card : int
var pupil_year_group : int
var pupil_disorder : int
var pupil_diagnosed : bool
var pupil_in_game : int # The day ticker for how long the pupil was in the school
# Money related variables
var pupil_income : float # Both dailies added together
var pupil_daily_income : float # Daily income from Pupil Fee
var pupil_state_income : float # Daily income from State Funding
# For the portrait generator
var pupil_face : int
var pupil_eyes : int
var pupil_hair : int
var pupil_shirt : int
func _ready():
randomize()
pupil_neg_chance = (randi() % 20) + 1
game_time.connect("year_heartbeat", self, "pupil_on_year_heartbeat")
game_time.connect("month_heartbeat", self, "pupil_on_month_heartbeat")
game_time.connect("heartbeat", self, "pupil_on_heartbeat")
player_vars.pupil_baseid += 1
pupil_gender = (randi() & 1)
randomize()
pupil_last_name = name_gen.last_name[randi() % name_gen.last_name.size()]
randomize()
if pupil_gender == true:
pupil_first_name = name_gen.boy_first_name[randi() % name_gen.boy_first_name.size()]
if pupil_gender == false:
pupil_first_name = name_gen.girl_first_name[randi() % name_gen.girl_first_name.size()]
pupil_id = player_vars.pupil_baseid
pupil_full_name = pupil_first_name + " " + pupil_last_name
registers.PupilRegister.append(pupil_full_name)
decide_year_group()
# SEN Need
randomize()
if pupil_neg_chance == 7:
pupil_disorder = randi() % 8
func decide_year_group():
if pupil_manager.year8_pop < pupil_manager.year1_max_pop:
pupil_year_group = 8
pupil_manager.year8_pop += 1
elif pupil_manager.year7_pop < pupil_manager.year2_max_pop:
pupil_year_group = 7
pupil_manager.year7_pop += 1
elif pupil_manager.year6_pop < pupil_manager.year3_max_pop:
pupil_year_group = 6
pupil_manager.year6_pop += 1
elif pupil_manager.year5_pop < pupil_manager.year4_max_pop:
pupil_year_group = 5
pupil_manager.year5_pop += 1
elif pupil_manager.year4_pop < pupil_manager.year5_max_pop:
pupil_year_group = 4
pupil_manager.year4_pop += 1
elif pupil_manager.year3_pop < pupil_manager.year6_max_pop:
pupil_year_group = 3
pupil_manager.year3_pop += 1
elif pupil_manager.year2_pop < pupil_manager.year7_max_pop:
pupil_year_group = 2
pupil_manager.year2_pop += 1
elif pupil_manager.year1_pop < pupil_manager.year8_max_pop:
pupil_year_group = 1
pupil_manager.year1_pop += 1
# pupil_year_group = (randi() % 8) + 1
func pupil_on_too_many():
if pupil_year_group == 1: pupil_manager.year1_pop -= 1
if pupil_year_group == 2: pupil_manager.year1_pop -= 2
if pupil_year_group == 3: pupil_manager.year1_pop -= 3
if pupil_year_group == 4: pupil_manager.year1_pop -= 4
if pupil_year_group == 5: pupil_manager.year1_pop -= 5
if pupil_year_group == 6: pupil_manager.year1_pop -= 6
if pupil_year_group == 7: pupil_manager.year1_pop -= 7
if pupil_year_group == 8: pupil_manager.year1_pop -= 8
registers.PupilRegister.remove(pupil_full_name)
queue_free()
func pupil_on_year_heartbeat():
pupil_year_group += 1
if pupil_year_group == 2:
pupil_manager.year1_pop -= 1
pupil_manager.year2_pop += 1
if pupil_year_group == 3:
pupil_manager.year2_pop -= 1
pupil_manager.year3_pop += 1
if pupil_year_group == 4:
pupil_manager.year3_pop -= 1
pupil_manager.year4_pop += 1
if pupil_year_group == 5:
pupil_manager.year4_pop -= 1
pupil_manager.year5_pop += 1
if pupil_year_group == 6:
pupil_manager.year5_pop -= 1
pupil_manager.year6_pop += 1
if pupil_year_group == 7:
pupil_manager.year6_pop -= 1
pupil_manager.year7_pop += 1
if pupil_year_group == 8:
pupil_manager.year7_pop -= 1
pupil_manager.year8_pop += 1
if pupil_year_group == 9:
pupil_manager.year8_pop -= 1
queue_free()
func pupil_on_month_heartbeat():
# Too many pupils
if player_vars.max_pupils < player_vars.pupil_pop:
pupil_on_too_many()
func pupil_on_heartbeat():
pupil_in_game += 1
player_vars.pupils_income += (player_vars.pupil_fee / 20) + (player_vars.pupil_funding / 20)
# PupilTracker stuff
pupil_manager.pa_pool += 1
pupil_manager.pe_pool += 1
pupil_manager.pw_pool += 1

6
godot/Pupil.tscn Normal file
View File

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Pupil.gd" type="Script" id=1]
[node name="Pupil" type="Node2D"]
script = ExtResource( 1 )

102
godot/Pupils.gd Normal file
View File

@ -0,0 +1,102 @@
extends Node
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
var pupil_agent = preload("res://Pupil.tscn")
var pupils_per_heartbeat : int
var pupil_tracker_achievement : int
var pa_pool : int
var pupil_tracker_enjoyment : int
var pe_pool : int
var pupil_tracker_wellbeing : int
var pw_pool : int
var pupil_tracker_total : int
var year1_max_pop : float
var year2_max_pop : float
var year3_max_pop : float
var year4_max_pop : float
var year5_max_pop : float
var year6_max_pop : float
var year7_max_pop : float
var year8_max_pop : float
var year1_pop : int
var year2_pop : int
var year3_pop : int
var year4_pop : int
var year5_pop : int
var year6_pop : int
var year7_pop : int
var year8_pop : int
# Called when the node enters the scene tree for the first time.
func _ready():
game_time.connect("heartbeat", self, "on_pupils_heartbeat")
pupil_tracker_achievement = 50
pupil_tracker_enjoyment = 50
pupil_tracker_wellbeing = 50
pupil_tracker_total = 50
func on_pupils_heartbeat():
player_vars.pupil_pop = get_child_count()
# Hieronder. Dit moet waarschijnlijk sequentially verhuizen om geen leerlingen onnodig de school uit te schoppen.
var ct_multiplier = player_vars.classroom_count - player_vars.teacher_pop
player_vars.max_pupils = (player_vars.classroom_count * player_vars.pupils_per_classroom)
if player_vars.classroom_count > player_vars.teacher_pop:
player_vars.max_pupils -= ct_multiplier * player_vars.pupils_per_classroom
pupil_tracker()
year1_max_pop = player_vars.max_pupils * 0.125
year2_max_pop = player_vars.max_pupils * 0.125
year3_max_pop = player_vars.max_pupils * 0.125
year4_max_pop = player_vars.max_pupils * 0.125
year5_max_pop = player_vars.max_pupils * 0.125
year6_max_pop = player_vars.max_pupils * 0.125
year7_max_pop = player_vars.max_pupils * 0.125
year8_max_pop = player_vars.max_pupils * 0.125
pupil_fill_spaces()
# Adding pupils when there is capacity - random number per day
func pupil_fill_spaces():
if (player_vars.max_pupils - player_vars.pupil_pop) > 6:
randomize()
pupils_per_heartbeat = randi() % 5
while pupils_per_heartbeat > 0:
add_pupil()
pupils_per_heartbeat -= 1
elif (player_vars.max_pupils - player_vars.pupil_pop) <= 6:
player_vars.pupil_difference = player_vars.max_pupils - player_vars.pupil_pop
pupils_per_heartbeat = player_vars.pupil_difference
while pupils_per_heartbeat > 0:
add_pupil()
pupils_per_heartbeat -= 1
func pupil_tracker():
if pa_pool > 0 && pupil_tracker_achievement < 100:
pupil_tracker_achievement += (pa_pool / player_vars.pupil_pop)
if pe_pool > 0 && pupil_tracker_enjoyment < 100:
pupil_tracker_enjoyment += (pe_pool / player_vars.pupil_pop)
if pw_pool > 0 && pupil_tracker_wellbeing < 100:
pupil_tracker_wellbeing += (pw_pool / player_vars.pupil_pop)
pa_pool = 0
pw_pool = 0
pe_pool = 0
pupil_tracker_total = int(float(pupil_tracker_achievement * 0.5 + pupil_tracker_enjoyment * 0.2 + pupil_tracker_wellbeing * 0.3))
func add_pupil():
var pupil = pupil_agent.instance()
add_child(pupil)
player_vars.pupil_pop = get_child_count()
func yeargroup_manager():
pass

2
godot/README.md Normal file
View File

@ -0,0 +1,2 @@
# SchoolSim

4
godot/Registers.gd Normal file
View File

@ -0,0 +1,4 @@
extends Node
var PupilRegister : Array = []
var TeacherRegister : Array = []

View File

@ -0,0 +1,79 @@
[gd_resource type="TileSet" load_steps=6 format=2]
[ext_resource path="res://Assets/grass.png" type="Texture" id=1]
[ext_resource path="res://Assets/road.png" type="Texture" id=2]
[ext_resource path="res://Assets/tree1.png" type="Texture" id=3]
[ext_resource path="res://Assets/road2.png" type="Texture" id=4]
[ext_resource path="res://Assets/road_crossing.png" type="Texture" id=5]
[resource]
0/name = "grass"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 130, 67 )
0/tile_mode = 0
0/occluder_offset = Vector2( 65, 33.5 )
0/navigation_offset = Vector2( 65, 33.5 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0
1/name = "road.png 1"
1/texture = ExtResource( 2 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 0, 1, 129, 72 )
1/tile_mode = 0
1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 )
1/shape_offset = Vector2( 0, 0 )
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
1/shape_one_way = false
1/shape_one_way_margin = 0.0
1/shapes = [ ]
1/z_index = 0
2/name = "tree1.png 2"
2/texture = ExtResource( 3 )
2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 32, 0, 69, 87 )
2/tile_mode = 0
2/occluder_offset = Vector2( 0, 0 )
2/navigation_offset = Vector2( 0, 0 )
2/shape_offset = Vector2( 0, 0 )
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
2/shape_one_way = false
2/shape_one_way_margin = 0.0
2/shapes = [ ]
2/z_index = 0
3/name = "road2.png 3"
3/texture = ExtResource( 4 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 0, 0, 129, 73 )
3/tile_mode = 0
3/occluder_offset = Vector2( 0, 0 )
3/navigation_offset = Vector2( 0, 0 )
3/shape_offset = Vector2( 0, 0 )
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
3/shape_one_way = false
3/shape_one_way_margin = 0.0
3/shapes = [ ]
3/z_index = 0
4/name = "road_crossing.png 4"
4/texture = ExtResource( 5 )
4/tex_offset = Vector2( 0, 0 )
4/modulate = Color( 1, 1, 1, 1 )
4/region = Rect2( 0, 0, 129, 73 )
4/tile_mode = 0
4/occluder_offset = Vector2( 0, 0 )
4/navigation_offset = Vector2( 0, 0 )
4/shape_offset = Vector2( 0, 0 )
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
4/shape_one_way = false
4/shape_one_way_margin = 0.0
4/shapes = [ ]
4/z_index = 0

19
godot/Rooms/CPDRoom.gd Normal file
View File

@ -0,0 +1,19 @@
extends Node2D
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
# Classroom variables
# Called when the node enters the scene tree for the first time.
func _ready():
# player_vars.max_pupils += player_vars.pupils_per_classroom
game_time.connect("heartbeat", self, "on_cpdroom_heartbeat")
game_time.connect("season_heartbeat", self, "on_cpdroom_season_heartbeat")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func on_cpdroom_heartbeat():
player_vars.operating_costs += (player_vars.cpdroom_operating / 20)
func on_cpdroom_season_heartbeat():
pass

11
godot/Rooms/CPDRoom.tscn Normal file
View File

@ -0,0 +1,11 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Assets/classroom_empty.png" type="Texture" id=1]
[ext_resource path="res://Rooms/CPDRoom.gd" type="Script" id=2]
[node name="CPDRoom" type="Node2D"]
script = ExtResource( 2 )
[node name="cpdroom_empty" type="Sprite" parent="."]
position = Vector2( 152.713, 124.123 )
texture = ExtResource( 1 )

View File

@ -0,0 +1,3 @@
[gd_scene format=2]
[node name="CTeacher" type="Node2D"]

19
godot/Rooms/Classroom.gd Normal file
View File

@ -0,0 +1,19 @@
extends Node2D
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
# Classroom variables
# Called when the node enters the scene tree for the first time.
func _ready():
# player_vars.max_pupils += player_vars.pupils_per_classroom
game_time.connect("heartbeat", self, "on_classroom_heartbeat")
game_time.connect("season_heartbeat", self, "on_classroom_season_heartbeat")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func on_classroom_heartbeat():
player_vars.operating_costs += (player_vars.classroom_operating / 20)
func on_classroom_season_heartbeat():
pass

View File

@ -0,0 +1,11 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Assets/classroom_empty.png" type="Texture" id=1]
[ext_resource path="res://Rooms/Classroom.gd" type="Script" id=2]
[node name="Classroom" type="Node2D"]
script = ExtResource( 2 )
[node name="classroom_empty" type="Sprite" parent="."]
position = Vector2( 152.713, 124.123 )
texture = ExtResource( 1 )

19
godot/Rooms/StaffRoom.gd Normal file
View File

@ -0,0 +1,19 @@
extends Node2D
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
# Classroom variables
# Called when the node enters the scene tree for the first time.
func _ready():
# player_vars.max_pupils += player_vars.pupils_per_classroom
game_time.connect("heartbeat", self, "on_staffroom_heartbeat")
game_time.connect("season_heartbeat", self, "on_staffroom_season_heartbeat")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func on_staffroom_heartbeat():
player_vars.operating_costs += (player_vars.staffroom_operating / 20)
func on_staffroom_season_heartbeat():
pass

View File

@ -0,0 +1,11 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Assets/classroom_empty.png" type="Texture" id=1]
[ext_resource path="res://Rooms/Classroom.gd" type="Script" id=2]
[node name="Staffroom" type="Node2D"]
script = ExtResource( 2 )
[node name="staffroom_empty" type="Sprite" parent="."]
position = Vector2( 152.713, 124.123 )
texture = ExtResource( 1 )

196
godot/UserInterface.gd Normal file
View File

@ -0,0 +1,196 @@
extends CanvasLayer
onready var player_vars = get_node("/root/PlayerVariables")
onready var game_time = get_node("/root/GameTimer")
onready var finances = get_node("/root/Finances")
onready var registers = get_node("/root/Registers")
onready var pupil_manager = get_node("/root/Main/Pupils")
onready var staff_manager = get_node("/root/Main/ClassTeachers")
var estimated_funds : int
func _ready():
game_time.connect("heartbeat", self, "_on_heartbeat")
update_ui_timers()
$BuildMenu/ClassroomCost.text = str(player_vars.classroom_cost)
func disable_menus():
$BudgetMenu.visible = false
$PolicyMenu.visible = false
$PrincipalMenu.visible = false
$HRMenu.visible = false
$DebugMenu.visible = false
$BuildMenu.visible = false
$InfoMenu.visible = false
func update_ui_timers():
$MainMenu/DayNumber.text = str(player_vars.day)
$MainMenu/WeekNumber.text = str(player_vars.week)
$MainMenu/MonthNumber.text = str(player_vars.month)
$MainMenu/YearNumber.text = str(player_vars.year)
if player_vars.season == 1:
$MainMenu/SeasonNumber.text = "Autumn"
if player_vars.season == 2:
$MainMenu/SeasonNumber.text = "Winter"
if player_vars.season == 3:
$MainMenu/SeasonNumber.text = "Spring"
if player_vars.season == 4:
$MainMenu/SeasonNumber.text = "Easter"
if player_vars.season == 5:
$MainMenu/SeasonNumber.text = "Summer"
func update_funds():
$MainMenu/FundsNumber.text = str(player_vars.funds)
$MainMenu/RatingNumber.text = str(player_vars.rating)
$MainMenu/PupilsNumber.text = str(player_vars.pupil_pop)
$MainMenu/PupilsMax.text = str(player_vars.max_pupils)
func update_trackers():
$DebugMenu/PupilAchievementNumber.text = str(pupil_manager.pupil_tracker_achievement)
$DebugMenu/PupilEnjoymentNumber.text = str(pupil_manager.pupil_tracker_enjoyment)
$DebugMenu/PupilWellbeingNumber.text = str(pupil_manager.pupil_tracker_wellbeing)
$DebugMenu/PupilTotalScoreNumber.text = str(pupil_manager.pupil_tracker_total)
$DebugMenu/TeacherAchievementNumber.text = str(staff_manager.staff_tracker_achievement)
$DebugMenu/TeacherEnjoymentNumber.text = str(staff_manager.staff_tracker_enjoyment)
$DebugMenu/TeacherWellbeingNumber.text = str(staff_manager.staff_tracker_wellbeing)
$DebugMenu/TeacherTotalScoreNumber.text = str(staff_manager.staff_tracker_total)
$MainMenu/Bars/PupilBar.value = pupil_manager.pupil_tracker_total
$MainMenu/Bars/TeacherBar.value = staff_manager.staff_tracker_total
$InfoMenu/Year1Number.text = str(pupil_manager.year1_pop)
$InfoMenu/Year2Number.text = str(pupil_manager.year2_pop)
$InfoMenu/Year3Number.text = str(pupil_manager.year3_pop)
$InfoMenu/Year4Number.text = str(pupil_manager.year4_pop)
$InfoMenu/Year5Number.text = str(pupil_manager.year5_pop)
$InfoMenu/Year6Number.text = str(pupil_manager.year6_pop)
$InfoMenu/Year7Number.text = str(pupil_manager.year7_pop)
$InfoMenu/Year8Number.text = str(pupil_manager.year8_pop)
func update_policy():
$PolicyMenu/ClassSize.text = str(player_vars.pupils_per_classroom)
func _process(_delta):
$DebugMenu/TestTimer.text = str(game_time.game_timer)
update_funds()
update_policy()
update_trackers()
func _on_heartbeat():
update_ui_timers()
$InfoMenu/PupilRegister.text = str(registers.PupilRegister)
func _on_SpeedOne_pressed():
game_time.paused = 0
game_time.wait_time = 6
func _on_SpeedTwo_pressed():
game_time.paused = 0
game_time.wait_time = 3
func _on_SpeedThree_pressed():
game_time.paused = 0
game_time.wait_time = 1
func _on_SpeedPause_pressed():
game_time.paused = 1
func _on_DebugMenuClose_pressed():
$DebugMenu.visible = false
func _on_DebugMenuOn_pressed():
if player_vars.has_staffroom == true:
$DebugMenu/StaffroomLabel.text = str("HasStaffroom")
if player_vars.has_cpdroom == true:
$DebugMenu/CPDRoomLabel.text = str("HasCPDRoom")
disable_menus()
$DebugMenu.visible = true
func _on_BuildMenuOn_pressed():
disable_menus()
$BuildMenu.visible = true
func _on_BuildMenuClose_pressed():
$BuildMenu.visible = false
func _on_ClassroomButton_pressed():
pass
func _on_BudgetMenuClose_pressed():
$BudgetMenu.visible = false
# $PausedRect.visible = false
# $MainMenu.visible = true
# $MenuButtons.visible = true
# game_time.paused = 0
func _on_BudgetMenuOn_pressed():
disable_menus()
$BudgetMenu.visible = true
# $PausedRect.visible = true
# $MainMenu.visible = false
# $MenuButtons.visible = false
# game_time.paused = 1
func _on_ClosePolicyMenu_pressed():
$PolicyMenu.visible = false
# game_time.paused = 0
func _on_PolicyMenuOn_pressed():
disable_menus()
$PolicyMenu.visible = true
# game_time.paused = 1
func _on_PupilFeeDecrease_pressed():
if player_vars.pupil_fee > 99:
player_vars.pupil_fee -= 100
func _on_PupilFeeIncrease_pressed():
player_vars.pupil_fee += 100
func _on_ClassSizeLower_pressed():
player_vars.pupils_per_classroom -= 1
func _on_ClassSizeRaise_pressed():
player_vars.pupils_per_classroom += 1
func _on_PrincipalMenuOn_pressed():
disable_menus()
$PrincipalMenu/NameLine.text = player_vars.principal_name
$PrincipalMenu/SchoolNameLine.text = player_vars.school_name
$PrincipalMenu.visible = true
func _on_ClosePrincipalMenu_pressed():
$PrincipalMenu.visible = false
func _on_HRMenuButton_pressed():
disable_menus()
$HRMenu.visible = true
func _on_CloseHRMenu_pressed():
$HRMenu.visible = false
func _on_NameLineOK_pressed():
player_vars.principal_name = $PrincipalMenu/NameLine.text
func _on_InfoButton_pressed():
disable_menus()
$InfoMenu.visible = true
func _on_InfoMenuClose_pressed():
$InfoMenu.visible = false

7
godot/default_env.tres Normal file
View File

@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

BIN
godot/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

35
godot/icon.png.import Normal file
View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

4
godot/makefile Normal file
View File

@ -0,0 +1,4 @@
git:
git add -A
git commit -m "$m"
git push

66
godot/project.godot Normal file
View File

@ -0,0 +1,66 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ ]
_global_script_class_icons={
}
[application]
config/name="School Simulator"
run/main_scene="res://Main.tscn"
config/icon="res://icon.png"
[autoload]
PlayerVariables="*res://PlayerVariables.gd"
GameTimer="*res://GameTimer.gd"
Finances="*res://Finances.gd"
NameGenerator="*res://NameGenerator.gd"
Registers="*res://Registers.gd"
[debug]
settings/fps/force_fps=30
[display]
window/size/width=1920
window/size/height=1080
window/dpi/allow_hidpi=true
window/stretch/mode="2d"
window/stretch/aspect="expand"
[input]
cam_drag={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
]
}
cam_zoom_in={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777349,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":4,"pressed":false,"doubleclick":false,"script":null)
]
}
cam_zoom_out={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777347,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":5,"pressed":false,"doubleclick":false,"script":null)
]
}
[rendering]
2d/snapping/use_gpu_pixel_snap=true
quality/filters/anisotropic_filter_level=1
environment/default_environment="res://default_env.tres"
quality/2d/use_pixel_snap=true

4
makefile Normal file
View File

@ -0,0 +1,4 @@
git:
git add -A
git commit -m "$m"
git push