diff options
author | Jonas Bernard <public.jbernard@web.de> | 2021-04-26 18:45:58 +0200 |
---|---|---|
committer | Jonas Bernard <public.jbernard@web.de> | 2021-04-26 18:45:58 +0200 |
commit | ed567bda49ed674c8995309fb905d6df10185724 (patch) | |
tree | 47ccad66f53b1d618d62deee5214061e2f19341f | |
parent | 773f698e255df6b9614bb3bbab49c9562ae5c262 (diff) | |
download | ldjam48-ed567bda49ed674c8995309fb905d6df10185724.tar.gz ldjam48-ed567bda49ed674c8995309fb905d6df10185724.tar.bz2 ldjam48-ed567bda49ed674c8995309fb905d6df10185724.zip |
Game Over
-rw-r--r-- | .import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.md5 | 2 | ||||
-rw-r--r-- | .import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.stex | bin | 8188 -> 8188 bytes | |||
-rw-r--r-- | scenes/game_over.gd | 5 | ||||
-rw-r--r-- | scenes/game_over.tscn | 37 | ||||
-rw-r--r-- | scenes/levels/base_level.gd | 4 | ||||
-rw-r--r-- | scenes/menu.tscn | 1 | ||||
-rw-r--r-- | textures/texts/game_over.png.import | 2 |
7 files changed, 46 insertions, 5 deletions
diff --git a/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.md5 b/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.md5 index dde93d3..3d9b482 100644 --- a/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.md5 +++ b/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.md5 @@ -1,3 +1,3 @@ source_md5="99e0c3fb7cb38fdb04e2131ac671ad1a" -dest_md5="f8448661c4d3091857ee81c9f9ab8b64" +dest_md5="dfed894a226c0b3be8dfce49f816abff" diff --git a/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.stex b/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.stex Binary files differindex ed15eb7..4ba0b1a 100644 --- a/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.stex +++ b/.import/game_over.png-de5b910a8c07fb0669574bb9ab6e36dd.stex diff --git a/scenes/game_over.gd b/scenes/game_over.gd new file mode 100644 index 0000000..0d1787a --- /dev/null +++ b/scenes/game_over.gd @@ -0,0 +1,5 @@ +extends Node2D + + +func _on_AnimationPlayer_animation_finished(anim_name): + get_tree().change_scene("res://scenes/menu.tscn") diff --git a/scenes/game_over.tscn b/scenes/game_over.tscn new file mode 100644 index 0000000..1a0aa37 --- /dev/null +++ b/scenes/game_over.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://textures/texts/game_over.png" type="Texture" id=1] +[ext_resource path="res://scenes/game_over.gd" type="Script" id=2] +[ext_resource path="res://textures/backgrounds/background_grey.png" type="Texture" id=3] + +[sub_resource type="Animation" id=1] +resource_name = "fly" +length = 3.048 +tracks/0/type = "bezier" +tracks/0/path = NodePath("Sprite:position:y") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"points": PoolRealArray( 92.8571, -0.25, 0, 0.47, 446.97, -924.456, -0.52, -186.363, 0.25, 0 ), +"times": PoolRealArray( 2, 3 ) +} + +[node name="Node2D" type="Node2D"] +position = Vector2( 403.175, 267.103 ) +script = ExtResource( 2 ) + +[node name="Sprite2" type="Sprite" parent="."] +position = Vector2( 194.362, 97.3519 ) +texture = ExtResource( 3 ) + +[node name="Sprite" type="Sprite" parent="."] +position = Vector2( 230.523, 73.7867 ) +scale = Vector2( 1.06474, 1.06474 ) +texture = ExtResource( 1 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "fly" +anims/fly = SubResource( 1 ) +[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"] diff --git a/scenes/levels/base_level.gd b/scenes/levels/base_level.gd index 66085c5..29f72d7 100644 --- a/scenes/levels/base_level.gd +++ b/scenes/levels/base_level.gd @@ -47,8 +47,8 @@ func _on_Level_lost_heart(instakill): if instakill: _health = 0 _health -= 1 - if _health == 0: - pass # TODO: lose scenario + if _health <= 0: + get_tree().change_scene("res://scenes/game_over.tscn") _health_bar.set_health(_health) func _load_next_level(): diff --git a/scenes/menu.tscn b/scenes/menu.tscn index 3828ad6..48707b6 100644 --- a/scenes/menu.tscn +++ b/scenes/menu.tscn @@ -194,7 +194,6 @@ anims/startgame = SubResource( 2 ) [node name="Outgoing" type="AnimationPlayer" parent="."] anims/tointro = SubResource( 3 ) anims/tosettings = SubResource( 4 ) - [connection signal="on_click" from="Content/Back" to="." method="_on_Back_on_click"] [connection signal="on_click" from="Content/HardMode" to="." method="_on_HardMode_on_click"] [connection signal="on_click" from="Content/Exit" to="." method="_on_Exit_on_click"] diff --git a/textures/texts/game_over.png.import b/textures/texts/game_over.png.import index c7228ca..39ff516 100644 --- a/textures/texts/game_over.png.import +++ b/textures/texts/game_over.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 |