From d48ac7b9fd725ab91f41a57884bafab294c7e216 Mon Sep 17 00:00:00 2001 From: Tabby <41929769+tabby-cat-nya@users.noreply.github.com> Date: Sat, 17 May 2025 17:26:28 +1000 Subject: [PATCH] game gaming --- game_logic.gd | 4 ++-- game_scene.tscn | 7 ++++--- games/reaction/reaction.gd | 11 +++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/game_logic.gd b/game_logic.gd index fbc0840..cf94ae0 100644 --- a/game_logic.gd +++ b/game_logic.gd @@ -15,8 +15,8 @@ signal game_over(score : int) @export var games : Array[PackedScene] @export var zoom_speed : float = 0.5 @export_group("Channel Rules") -@export var target_channels : float = 1.5 -@export var channel_growth_per_min : float = 4 +@export var target_channels : float = 1 +@export var channel_growth_per_min : float = 0.8 @export_group("Node References") @export var main_camera : Camera2D diff --git a/game_scene.tscn b/game_scene.tscn index 90c3811..b132c1b 100644 --- a/game_scene.tscn +++ b/game_scene.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://ct8axfbvd2wn4"] +[gd_scene load_steps=17 format=3 uid="uid://ct8axfbvd2wn4"] [ext_resource type="Script" uid="uid://d2q6xfk8htbyy" path="res://game_logic.gd" id="1_j5hk1"] [ext_resource type="PackedScene" uid="uid://63rik2noj8id" path="res://base modules/test_channel.tscn" id="1_mlf6e"] @@ -11,6 +11,7 @@ [ext_resource type="PackedScene" uid="uid://drk2fwkv816qv" path="res://games/crafting/crafting.tscn" id="9_udeyl"] [ext_resource type="Texture2D" uid="uid://baf30tscdkl0i" path="res://sprites/tv_remote.png" id="11_j5hk1"] [ext_resource type="Script" uid="uid://ca41i40uerrbr" path="res://games/platformer/platformer_channel.gd" id="11_mlphb"] +[ext_resource type="PackedScene" uid="uid://bcu5svl5gjd4r" path="res://games/reaction/reaction.tscn" id="11_opqoc"] [ext_resource type="Script" uid="uid://dgq2y6wjlye6" path="res://chatboxController.gd" id="11_ueiaa"] [ext_resource type="Script" uid="uid://dnptjh111yd8i" path="res://itemPopup.gd" id="12_daj04"] @@ -94,8 +95,8 @@ channel_scene = ExtResource("7_6e45b") [node name="Control8" parent="GridContainer" instance=ExtResource("1_mlf6e")] layout_mode = 2 -channel_name = "Space Invaders" -channel_scene = ExtResource("9_miq82") +channel_name = "Reaction" +channel_scene = ExtResource("11_opqoc") [node name="Control7" parent="GridContainer" instance=ExtResource("1_mlf6e")] layout_mode = 2 diff --git a/games/reaction/reaction.gd b/games/reaction/reaction.gd index 29bcd94..a82bc92 100644 --- a/games/reaction/reaction.gd +++ b/games/reaction/reaction.gd @@ -3,7 +3,8 @@ extends Node signal game_win signal game_lose -@export var reaction_window : float = 1 +@export var grace : float = 3 +@export var reaction_window : float = 1.5 @export_group("Node References") @export var prepare_node : Control @export var press_node : Control @@ -20,6 +21,7 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: time_remaining -= delta + grace -= delta prepare_node.visible = time_remaining > 0 press_node.visible = time_remaining <= 0 if(time_remaining <= 0): @@ -30,9 +32,10 @@ func _process(delta: float) -> void: game_win.emit() #winner else: - print("reaction lose") - game_lose.emit() - #loser + if(grace <= 0): + print("reaction lose") + game_lose.emit() + #loser if(reaction_window <= 0): print("reaction lose") game_lose.emit()