diff --git a/CREDITS.md b/CREDITS.md index 4e54a64..f13a2c6 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -8,6 +8,8 @@ - https://freesound.org/people/craigsmith/sounds/483320/ - https://freesound.org/people/Logicogonist/sounds/685293/ +- https://www.youtube.com/watch?v=PP7WJL2JtLs (NOT CC0) +- https://www.youtube.com/watch?v=vG2I7r4qlEA (NOT CC0) # Fonts diff --git a/godot/assets/sounds/scream_0.wav b/godot/assets/sounds/scream_0.wav new file mode 100644 index 0000000..5bee4f5 Binary files /dev/null and b/godot/assets/sounds/scream_0.wav differ diff --git a/godot/assets/sounds/scream_0.wav.import b/godot/assets/sounds/scream_0.wav.import new file mode 100644 index 0000000..b5da506 --- /dev/null +++ b/godot/assets/sounds/scream_0.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cue207ror7nu1" +path="res://.godot/imported/scream_0.wav-02df26ebad5a19c7729367e401d0d455.sample" + +[deps] + +source_file="res://assets/sounds/scream_0.wav" +dest_files=["res://.godot/imported/scream_0.wav-02df26ebad5a19c7729367e401d0d455.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/godot/assets/sounds/scream_1.wav b/godot/assets/sounds/scream_1.wav new file mode 100644 index 0000000..0c1f078 Binary files /dev/null and b/godot/assets/sounds/scream_1.wav differ diff --git a/godot/assets/sounds/scream_1.wav.import b/godot/assets/sounds/scream_1.wav.import new file mode 100644 index 0000000..095b492 --- /dev/null +++ b/godot/assets/sounds/scream_1.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bpwo61rj7l875" +path="res://.godot/imported/scream_1.wav-31f38f99f8e9098584bf4fec372c5d41.sample" + +[deps] + +source_file="res://assets/sounds/scream_1.wav" +dest_files=["res://.godot/imported/scream_1.wav-31f38f99f8e9098584bf4fec372c5d41.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/godot/main_scenes/game.tscn b/godot/main_scenes/game.tscn index 553ebbd..fd123b6 100644 --- a/godot/main_scenes/game.tscn +++ b/godot/main_scenes/game.tscn @@ -61,20 +61,24 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, [node name="player_3" parent="players" instance=ExtResource("6_8vhnl")] transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 4, 0, 0) -[node name="Camera3D" type="Camera3D" parent="."] +[node name="CAMERA" type="Camera3D" parent="."] +unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 0.910084, 0.414423, 0, -0.414423, 0.910084, 0, 3.4199, 0) -fov = 60.0 +fov = 39.7 +size = 0.013 script = ExtResource("2_joe7c") -[node name="RULE_ENFORCEMENT" parent="Camera3D" instance=ExtResource("7_0rqic")] +[node name="RULE_ENFORCEMENT" parent="CAMERA" instance=ExtResource("7_0rqic")] unique_name_in_owner = true transform = Transform3D(-0.0475354, -0.0535728, 0.270738, 0.266451, 0.0626881, 0.0591871, -0.0719257, 0.267636, 0.0403304, 0.0257539, -0.692888, -4.06508) [node name="UI" type="Control" parent="."] layout_mode = 3 -anchors_preset = 0 -offset_right = 40.0 -offset_bottom = 40.0 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 [node name="PanelContainer" type="PanelContainer" parent="UI"] layout_mode = 0 @@ -84,9 +88,11 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_sp4xh") [node name="VBoxContainer" type="VBoxContainer" parent="UI/PanelContainer"] layout_mode = 2 +alignment = 2 [node name="HBoxContainer" type="HBoxContainer" parent="UI/PanelContainer/VBoxContainer"] layout_mode = 2 +alignment = 2 [node name="QUESTION" type="Label" parent="UI/PanelContainer/VBoxContainer/HBoxContainer"] unique_name_in_owner = true @@ -111,4 +117,8 @@ drag_and_drop_selection_enabled = false flat = true caret_blink = true +[node name="SCREAM" type="AudioStreamPlayer3D" parent="."] +unique_name_in_owner = true +panning_strength = 0.0 + [connection signal="text_submitted" from="UI/PanelContainer/VBoxContainer/HBoxContainer/ANSWER" to="." method="_on_answer_text_submitted"] diff --git a/godot/scripts/ai.gd b/godot/scripts/ai.gd index 242b970..60a60e4 100644 --- a/godot/scripts/ai.gd +++ b/godot/scripts/ai.gd @@ -36,7 +36,7 @@ func _physics_process(_delta: float) -> void: elif clock > wait_time: if %ANSWER.text == "": - %ANSWER.text = str(GLOBALVARS.current_solution) if is_correct else str(GLOBALVARS.current_solution+randi_range(-10,10)) + %ANSWER.text = str(GLOBALVARS.current_solution) if is_correct else str(GLOBALVARS.current_solution+randi_range(-2,2)) elif clock > wait_time + 30: %ANSWER.emit_signal("text_submitted",%ANSWER.text) currently_executing = false diff --git a/godot/scripts/gamemaster.gd b/godot/scripts/gamemaster.gd index 6e2b6a5..cc47edb 100644 --- a/godot/scripts/gamemaster.gd +++ b/godot/scripts/gamemaster.gd @@ -1,6 +1,7 @@ extends Node var cooldown:int = 0 +static var SCREAM_ARRAY:Array = [0,1] func _determine_seconds_left() -> float: var difficulty_calc:float = 20-float(GLOBALVARS.difficulty) @@ -16,6 +17,8 @@ func _on_answer_text_submitted(_new_text: String) -> void: GLOBALVARS.seconds_left = _determine_seconds_left() _generate_question() else: + %SCREAM.stream = load("res://assets/sounds/scream_%s.wav" % SCREAM_ARRAY.pick_random()) + %SCREAM.play() %RULE_ENFORCEMENT.explode() cooldown = 60 GLOBALVARS.rotation_paused = true @@ -41,8 +44,8 @@ func _generate_question() -> void: GLOBALVARS.current_solution = x-y GLOBALVARS.current_operand = "-" elif rand_int == 2: - x = randi_range(0,10) # simplify multiplication - y = randi_range(0,10) + x = randi_range(0,15) # simplify multiplication + y = randi_range(0,15) GLOBALVARS.current_solution = x*y GLOBALVARS.current_operand = "*" elif rand_int == 3: @@ -84,13 +87,14 @@ func _physics_process(_delta: float) -> void: GLOBALVARS.selected_player = (GLOBALVARS.selected_player+1)%4 _generate_question() + %RULE_ENFORCEMENT.reset_rule_enforcement_device() + GLOBALVARS.rotation_paused = false elif 0 in GLOBALVARS.players_remaining: - pass # WIN CONDITION + get_tree().change_scene_to_file("res://main_scenes/menu.tscn") + else: get_tree().change_scene_to_file("res://main_scenes/menu.tscn") - GLOBALVARS.rotation_paused = false - %RULE_ENFORCEMENT.reset_rule_enforcement_device() elif GLOBALVARS.rotation_paused: cooldown -= 1