Added goose_talk() to the global event bus. And a goose.
This commit is contained in:
parent
614c5b5f78
commit
69b3b935ad
10 changed files with 80 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
16
scenes/goose.gd
Normal file
16
scenes/goose.gd
Normal file
|
|
@ -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()
|
||||
|
||||
1
scenes/goose.gd.uid
Normal file
1
scenes/goose.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dlojuida57qag
|
||||
10
scenes/goose.tscn
Normal file
10
scenes/goose.tscn
Normal file
|
|
@ -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")
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
BIN
sprites/goose.png
Normal file
BIN
sprites/goose.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
40
sprites/goose.png.import
Normal file
40
sprites/goose.png.import
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue