summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2024-04-15 10:04:22 +0700
committeraltaf-creator <dev@altafcreator.com>2024-04-15 10:04:22 +0700
commita2b2d15604d4e8f5b4d7717e8cfc536d8df677d2 (patch)
treea4ecf885b6d8be5f9062f505a7c38ab189b7fbd8
parent074227281d6b90a70bd39eb05222d45cc5474cf3 (diff)
fix bugs, incorrect sounds on modifier, fix game finishes when ai is still calculating modifier
-rw-r--r--Levels/game.tscn16
-rw-r--r--Scripts/GameLoop.gd15
-rw-r--r--Scripts/NumberNode.gd17
-rw-r--r--export_presets.cfg140
-rw-r--r--project.godot2
5 files changed, 168 insertions, 22 deletions
diff --git a/Levels/game.tscn b/Levels/game.tscn
index 17094fb..8f54ce9 100644
--- a/Levels/game.tscn
+++ b/Levels/game.tscn
@@ -130,7 +130,7 @@ loop_mode = 1
[sub_resource type="Animation" id="Animation_ugcil"]
resource_name = "win"
-length = 7.0
+length = 4.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
@@ -138,7 +138,7 @@ tracks/0/path = NodePath("TextureRect2:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
-"times": PackedFloat32Array(1.00255, 1.11788, 1.45173),
+"times": PackedFloat32Array(0, 0.1, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0.003, 0.003), Vector2(0.42251, 0.392513)]
@@ -150,7 +150,7 @@ tracks/1/path = NodePath("TextureRect:scale")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
-"times": PackedFloat32Array(1.11412, 1.17928, 1.50156),
+"times": PackedFloat32Array(0.1, 0.2, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0.1, 0.1), Vector2(0.4, 0.4)]
@@ -162,7 +162,7 @@ tracks/2/path = NodePath("WonLabel:scale")
tracks/2/interp = 2
tracks/2/loop_wrap = true
tracks/2/keys = {
-"times": PackedFloat32Array(1.32477, 2.07709),
+"times": PackedFloat32Array(0.3, 1.1),
"transitions": PackedFloat32Array(0.258816, 2.12929),
"update": 0,
"values": [Vector2(0, 0), Vector2(1, 1)]
@@ -174,7 +174,7 @@ tracks/3/path = NodePath("WonLabel:position")
tracks/3/interp = 2
tracks/3/loop_wrap = true
tracks/3/keys = {
-"times": PackedFloat32Array(1.38495, 2.07709),
+"times": PackedFloat32Array(0.4, 1.1),
"transitions": PackedFloat32Array(0.210224, 0.659754),
"update": 0,
"values": [Vector2(530, 300), Vector2(0, 0)]
@@ -186,7 +186,7 @@ tracks/4/path = NodePath("ResetLabel2:theme_override_colors/font_color")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
-"times": PackedFloat32Array(2.65637, 3.63815),
+"times": PackedFloat32Array(1.7, 2.6),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0.717647, 0.717647, 0.717647, 0), Color(0.717647, 0.717647, 0.717647, 1)]
@@ -198,7 +198,7 @@ tracks/5/path = NodePath("ResetLabel2:theme_override_colors/font_outline_color")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
-"times": PackedFloat32Array(2.66013, 3.62686),
+"times": PackedFloat32Array(1.7, 2.6),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0.113725, 0.184314, 0.541176, 0), Color(0.113725, 0.184314, 0.541176, 1)]
@@ -220,7 +220,7 @@ max_nodes = 90
[node name="GameLoop" type="Node" parent="." node_paths=PackedStringArray("label", "turn_label", "win_control", "anim", "anim_label")]
script = ExtResource("3_u7xnc")
-turns = 10
+turns = 2
label = NodePath("../Control/HBoxContainer/Label")
turn_label = NodePath("../Control/TurnLabel")
level = "res://Levels/game.tscn"
diff --git a/Scripts/GameLoop.gd b/Scripts/GameLoop.gd
index 9edc99a..5d3c3f4 100644
--- a/Scripts/GameLoop.gd
+++ b/Scripts/GameLoop.gd
@@ -37,22 +37,19 @@ func _on_between_player_and_ai_timeout():
else: turn_label.text = ""
if current_turns >= turns:
+ $"AudioDelay".start()
+
+func _on_audio_delay_timeout():
win_control.visible = true
anim.play("win")
anim_label.size = Vector2(1280, 720)
- if GlobalVariables.player.get_node("..").value > GlobalVariables.ai.get_node("..").value:
- anim_label.text = "YOU won!"
- elif GlobalVariables.player.get_node("..").value < GlobalVariables.ai.get_node("..").value:
- anim_label.text = "AI won!"
- else:
- anim_label.text = "It's a TIE!"
- $"AudioDelay".start()
-
-func _on_audio_delay_timeout():
if GlobalVariables.player.get_node("..").value > GlobalVariables.ai.get_node("..").value:
+ anim_label.text = "YOU won!"
win_control.get_node("Win").play()
elif GlobalVariables.player.get_node("..").value < GlobalVariables.ai.get_node("..").value:
win_control.get_node("Lose").play()
+ anim_label.text = "AI won!"
else:
win_control.get_node("Win").play()
+ anim_label.text = "It's a TIE!"
diff --git a/Scripts/NumberNode.gd b/Scripts/NumberNode.gd
index b15f535..10a12e7 100644
--- a/Scripts/NumberNode.gd
+++ b/Scripts/NumberNode.gd
@@ -48,16 +48,21 @@ func _physics_process(_delta):
func join_from(node : NumberNode):
var prev_value = node.value
+ self.stored_prev_value = prev_value
node.value += self.value
+
if self.modifier_operation != Operations.NONE:
+ stored_node = node
+ self.stored_prev_value = node.value
$"ModifierTimer".start()
GlobalVariables.gameloop.get_node("BetweenPlayerAndAI").wait_time = 2
- stored_node = node
- stored_prev_value = prev_value
+ if GlobalVariables.gameloop.current_turns + 1 >= GlobalVariables.gameloop.turns:
+ GlobalVariables.gameloop.get_node("AudioDelay").wait_time = 2
else:
GlobalVariables.gameloop.get_node("BetweenPlayerAndAI").wait_time = 1
+ GlobalVariables.gameloop.get_node("AudioDelay").wait_time = 1
node.target_pos = self.position
node.update_visuals()
@@ -111,7 +116,6 @@ func softlock_check():
func _on_modifier_timer_timeout():
var node = stored_node
- var prev_value = stored_prev_value
var modifier_label = node.get_node_or_null("Control/ModifierLabel")
@@ -130,10 +134,13 @@ func _on_modifier_timer_timeout():
node.get_node("Control/AnimationPlayer").play("mod")
node.update_visuals()
-
- if node.value >= prev_value:
+
+ if node.value >= self.stored_prev_value:
+ print(str(node.value) + " >= " + str(self.stored_prev_value))
node.get_node("Score").playing = true
else:
node.get_node("Ouch").playing = true
+
+ self.stored_prev_value = node.value
queue_free()
diff --git a/export_presets.cfg b/export_presets.cfg
new file mode 100644
index 0000000..ab14181
--- /dev/null
+++ b/export_presets.cfg
@@ -0,0 +1,140 @@
+[preset.0]
+
+name="Web"
+platform="Web"
+runnable=true
+dedicated_server=false
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path="../../Godot Builds/Ludum Dare 55/index.html"
+encryption_include_filters=""
+encryption_exclude_filters=""
+encrypt_pck=false
+encrypt_directory=false
+
+[preset.0.options]
+
+custom_template/debug=""
+custom_template/release=""
+variant/extensions_support=false
+vram_texture_compression/for_desktop=true
+vram_texture_compression/for_mobile=false
+html/export_icon=true
+html/custom_html_shell=""
+html/head_include=""
+html/canvas_resize_policy=2
+html/focus_canvas_on_start=true
+html/experimental_virtual_keyboard=false
+progressive_web_app/enabled=false
+progressive_web_app/offline_page=""
+progressive_web_app/display=1
+progressive_web_app/orientation=0
+progressive_web_app/icon_144x144=""
+progressive_web_app/icon_180x180=""
+progressive_web_app/icon_512x512=""
+progressive_web_app/background_color=Color(0, 0, 0, 1)
+
+[preset.1]
+
+name="Linux/X11"
+platform="Linux/X11"
+runnable=true
+dedicated_server=false
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path="../../Godot Builds/Ludum Dare 55/Linux/sum.x86_64"
+encryption_include_filters=""
+encryption_exclude_filters=""
+encrypt_pck=false
+encrypt_directory=false
+
+[preset.1.options]
+
+custom_template/debug=""
+custom_template/release=""
+debug/export_console_wrapper=1
+binary_format/embed_pck=false
+texture_format/bptc=true
+texture_format/s3tc=true
+texture_format/etc=false
+texture_format/etc2=false
+binary_format/architecture="x86_64"
+ssh_remote_deploy/enabled=false
+ssh_remote_deploy/host="user@host_ip"
+ssh_remote_deploy/port="22"
+ssh_remote_deploy/extra_args_ssh=""
+ssh_remote_deploy/extra_args_scp=""
+ssh_remote_deploy/run_script="#!/usr/bin/env bash
+export DISPLAY=:0
+unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
+\"{temp_dir}/{exe_name}\" {cmd_args}"
+ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
+kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
+rm -rf \"{temp_dir}\""
+
+[preset.2]
+
+name="Windows Desktop"
+platform="Windows Desktop"
+runnable=true
+dedicated_server=false
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path="../../Godot Builds/Ludum Dare 55/Windows/sum.exe"
+encryption_include_filters=""
+encryption_exclude_filters=""
+encrypt_pck=false
+encrypt_directory=false
+
+[preset.2.options]
+
+custom_template/debug=""
+custom_template/release=""
+debug/export_console_wrapper=1
+binary_format/embed_pck=false
+texture_format/bptc=true
+texture_format/s3tc=true
+texture_format/etc=false
+texture_format/etc2=false
+binary_format/architecture="x86_64"
+codesign/enable=false
+codesign/timestamp=true
+codesign/timestamp_server_url=""
+codesign/digest_algorithm=1
+codesign/description=""
+codesign/custom_options=PackedStringArray()
+application/modify_resources=true
+application/icon=""
+application/console_wrapper_icon=""
+application/icon_interpolation=4
+application/file_version=""
+application/product_version=""
+application/company_name=""
+application/product_name=""
+application/file_description=""
+application/copyright=""
+application/trademarks=""
+application/export_angle=0
+ssh_remote_deploy/enabled=false
+ssh_remote_deploy/host="user@host_ip"
+ssh_remote_deploy/port="22"
+ssh_remote_deploy/extra_args_ssh=""
+ssh_remote_deploy/extra_args_scp=""
+ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
+$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
+$trigger = New-ScheduledTaskTrigger -Once -At 00:00
+$settings = New-ScheduledTaskSettingsSet
+$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
+Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
+Start-ScheduledTask -TaskName godot_remote_debug
+while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
+Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
+ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
+Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
+Remove-Item -Recurse -Force '{temp_dir}'"
diff --git a/project.godot b/project.godot
index b3b9050..3ca19ff 100644
--- a/project.godot
+++ b/project.godot
@@ -43,3 +43,5 @@ space={
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
+anti_aliasing/icon="res://Assets/Visuals/logo_sum_on.png"
+anti_aliasing/name="Sum on!"