From 69b3b935ad0f1b278c5a98dbb5715fb8df442c23 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 11 Feb 2026 22:08:24 +0000 Subject: [PATCH] Added goose_talk() to the global event bus. And a goose. --- scenes/event_bus.gd | 1 + scenes/goose.gd | 16 ++++++++++++++++ scenes/goose.gd.uid | 1 + scenes/goose.tscn | 10 ++++++++++ scenes/main.gd | 2 ++ scenes/main.tscn | 8 +++++++- scenes/player.gd | 4 ++-- scenes/player.tscn | 1 + sprites/goose.png | Bin 0 -> 1859 bytes sprites/goose.png.import | 40 +++++++++++++++++++++++++++++++++++++++ 10 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 scenes/goose.gd create mode 100644 scenes/goose.gd.uid create mode 100644 scenes/goose.tscn create mode 100644 sprites/goose.png create mode 100644 sprites/goose.png.import diff --git a/scenes/event_bus.gd b/scenes/event_bus.gd index 8327477..55c37f7 100644 --- a/scenes/event_bus.gd +++ b/scenes/event_bus.gd @@ -8,5 +8,6 @@ signal enemy_died() signal enemy_hit(value: int) signal initialize_shieldbar() signal start_game() +signal goose_talk() @warning_ignore_restore("unused_signal") # put any future signals you add between the two ignore annotations diff --git a/scenes/goose.gd b/scenes/goose.gd new file mode 100644 index 0000000..f1930df --- /dev/null +++ b/scenes/goose.gd @@ -0,0 +1,16 @@ +extends Area2D + + +func _ready() -> void: + EventBus.goose_talk.connect(_on_goose_talk) + + +func _on_goose_talk(): + print("QUACK") + self.show() + #var tween = create_tween() + #tween.tween_property(self, "position:x", +5, .5).set_ease(tween.EASE_OUT) + await get_tree().create_timer(3).timeout + #tween.tween_property(self, "position:x", -5, .5) + self.hide() + diff --git a/scenes/goose.gd.uid b/scenes/goose.gd.uid new file mode 100644 index 0000000..21bc5ea --- /dev/null +++ b/scenes/goose.gd.uid @@ -0,0 +1 @@ +uid://dlojuida57qag diff --git a/scenes/goose.tscn b/scenes/goose.tscn new file mode 100644 index 0000000..bae8772 --- /dev/null +++ b/scenes/goose.tscn @@ -0,0 +1,10 @@ +[gd_scene format=3 uid="uid://cd1kwb8klcsb5"] + +[ext_resource type="Script" uid="uid://dlojuida57qag" path="res://scenes/goose.gd" id="1_wf0t2"] +[ext_resource type="Texture2D" uid="uid://budoyq517fj7r" path="res://sprites/goose.png" id="1_wo8sg"] + +[node name="Goose" type="Area2D" unique_id=1594509381] +script = ExtResource("1_wf0t2") + +[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1690665905] +texture = ExtResource("1_wo8sg") diff --git a/scenes/main.gd b/scenes/main.gd index c7506be..2d586a4 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -56,6 +56,7 @@ func _on_enemy_died(): if enemy_count == ROWS * COLS / 2: print_debug("Enemy count is 50%") update_enemy_aggression(2,10) + EventBus.goose_talk.emit() if enemy_count == ROWS * COLS / 4: print_debug("Enemy count is 25%") update_enemy_aggression(1,1) @@ -113,6 +114,7 @@ func new_game(): # Tell the enemies to spawn! #await get_tree().create_timer(.5).timeout spawn_enemies() + # Tell the game we're playing. playing = true diff --git a/scenes/main.tscn b/scenes/main.tscn index 8ab010b..a1cef78 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -8,6 +8,7 @@ [ext_resource type="Texture2D" uid="uid://bonoqs5pisflo" path="res://_graphics/Mini Pixel Pack 3/UI objects/START (48 x 8).png" id="5_lquwl"] [ext_resource type="Texture2D" uid="uid://0mcbtnidp5kn" path="res://sprites/third space title.png" id="5_tipki"] [ext_resource type="Texture2D" uid="uid://bubqwoum50gf8" path="res://_graphics/Mini Pixel Pack 3/UI objects/GAME_OVER (72 x 8).png" id="6_7mycd"] +[ext_resource type="PackedScene" uid="uid://cd1kwb8klcsb5" path="res://scenes/goose.tscn" id="9_85g3d"] [sub_resource type="Animation" id="Animation_1bvp3"] length = 0.001 @@ -70,7 +71,7 @@ autoplay = &"scroll" [node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1849605109] [node name="UI" parent="CanvasLayer" unique_id=1138646344 instance=ExtResource("4_1bvp3")] -offset_right = 196.0 +offset_right = -1.0 offset_bottom = 36.0 [node name="Title" type="TextureRect" parent="CanvasLayer" unique_id=561106216] @@ -106,4 +107,9 @@ texture = ExtResource("3_tipki") centered = false region_rect = Rect2(0, 0, 240, 320) +[node name="Goose" parent="." unique_id=1594509381 instance=ExtResource("9_85g3d")] +visible = false +z_index = 2 +position = Vector2(233, 272) + [connection signal="pressed" from="CanvasLayer/CenterContainer/Start" to="." method="_on_start_pressed"] diff --git a/scenes/player.gd b/scenes/player.gd index ca366cf..e22c272 100644 --- a/scenes/player.gd +++ b/scenes/player.gd @@ -99,7 +99,7 @@ func set_shield(value: int): $Explosion/AnimationPlayer.play("explosion-one-shot") await $Explosion/AnimationPlayer.animation_finished EventBus.player_died.emit() - + func _on_gun_cooldown_timeout() -> void: $HeadInflate.play() @@ -108,7 +108,7 @@ func _on_gun_cooldown_timeout() -> void: await get_tree().create_timer(0.25).timeout var tween = create_tween().set_parallel(false) $Ship/Head.show() - tween.tween_property($Ship/Head, "scale", Vector2(2,2), .15).set_trans(Tween.TRANS_BOUNCE) + tween.tween_property($Ship/Head, "scale", Vector2(.25,2.5), .15).set_trans tween.tween_property($Ship/Head, "scale", Vector2(1,1), .10).set_trans(Tween.TRANS_BOUNCE) can_shoot = true diff --git a/scenes/player.tscn b/scenes/player.tscn index 3c81894..e70f0f0 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -121,6 +121,7 @@ trail_sections = 2 process_material = SubResource("ParticleProcessMaterial_b26j0") [node name="Head" type="Sprite2D" parent="Ship" unique_id=522385006] +z_index = -1 position = Vector2(1, -17) texture = ExtResource("8_ur7pv") hframes = 3 diff --git a/sprites/goose.png b/sprites/goose.png new file mode 100644 index 0000000000000000000000000000000000000000..f1b7087ce1da22285bf4971a91435f8b240b3da9 GIT binary patch literal 1859 zcmV-J2fX-+P)Px*{YgYYRCt{2oiRvUNf^h!J&s%@o+!r}M1(~|iR~43UU3}Zz;au;Kp=%hIJ;bH z7fF%gDn+=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22qzAEq4`K**ggoHh!Ylu`tgoHhCxnRH!Bn0e0Lck6r1nfXUCQ=z-*&r$jQ~JY= zj7=u>`_v&S2|=1bLMFu3zL16yO;)G+#}Zfn8sy1qBq1|M#7HD;j<>og-F>sY)XqE} zbP=PFFeQra=Q5}w1}~vVK}z7V9z_Dm_evQw5u>@wXYA@Sm-g0b}pRRQ0<|EMKkS^A51 zNJYjVlQ4xc?DAH)dFiMUlc2##Xd+;Hsclr+eBk3g%%pec(P;XTK~2$^3P>LR=sFbb zi|&9#m$J!w@&7SQ_XLrIqM=Mma4!Mdw6V5AI@iu|Nk|8Sj6B^#fhJ=R5|V`*T62n6 zCZI?`8-o&4a_-HSNyZSQWZwZYD8uULSd`?SfBYfyye}Db((l=;x7vMIj=@;J83&(o z2Gu95irU}uQ5to(5#r!UM)V!kpXPY0>#IK*brMoR8VYQuqKV+T^Mb^bf;#w^lMF&a z(iE{@>1Z#t`${NNN60GaYO=jhB^0P_Z&S+XB^2e(L=qD@>Xh~rlCU2(SAz#LIvqGiZp^%K%YzcS>$AOHXW0000X@jpO{E%|AujVu5F002ovPDHLkV1i{JW@!Kb literal 0 HcmV?d00001 diff --git a/sprites/goose.png.import b/sprites/goose.png.import new file mode 100644 index 0000000..2867a93 --- /dev/null +++ b/sprites/goose.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://budoyq517fj7r" +path="res://.godot/imported/goose.png-72daf264b05b1099965d4f0f009d11a6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/goose.png" +dest_files=["res://.godot/imported/goose.png-72daf264b05b1099965d4f0f009d11a6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1