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 0000000..f1b7087 Binary files /dev/null and b/sprites/goose.png differ 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