Added a game manager and better gameplay loop

This commit is contained in:
winniewk committed 2024-08-19 21:09:36 -04:00
1 parent b3b955e0c4
commit 334167167f
119 files changed
+523 -146

No files matched your search

+3 -3
View File
@@ -258,10 +258,8 @@ metadata/_edit_group_ = true
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_a6t6h")
animation = &"death"
animation = &"idle"
autoplay = "idle"
frame = 9
frame_progress = 1.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 3)
@@ -280,3 +278,5 @@ position = Vector2(16, -6)
[node name="MarkerLeft" type="Node2D" parent="."]
position = Vector2(-16, -6)
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="onAnimationFinished"]
+17 -4
View File
@@ -1,15 +1,16 @@
[gd_scene load_steps=15 format=3 uid="uid://y083suj12rld"]
[gd_scene load_steps=16 format=3 uid="uid://y083suj12rld"]
[ext_resource type="Script" path="res://scripts/gamecontroller.gd" id="1_77wyw"]
[ext_resource type="PackedScene" uid="uid://go4yc8hfo1gq" path="res://scenes/character.tscn" id="2_64ccm"]
[ext_resource type="Texture2D" uid="uid://dwb83f7uoweuy" path="res://graphics/Terrain (32x32).png" id="2_l22q1"]
[ext_resource type="Script" path="res://scripts/trigger.gd" id="2_nfj1w"]
[ext_resource type="Script" path="res://scripts/Trigger.gd" id="2_nfj1w"]
[ext_resource type="Texture2D" uid="uid://doodiicuxeb53" path="res://graphics/background/BG Image.png" id="3_1agog"]
[ext_resource type="Texture2D" uid="uid://ry5bkalocmx5" path="res://graphics/background/Additional Sky.png" id="4_g10bt"]
[ext_resource type="Texture2D" uid="uid://cl2dnusewe0ch" path="res://graphics/background/Additional Water.png" id="5_ax33h"]
[ext_resource type="PackedScene" uid="uid://ukuu7p7vhlq" path="res://scenes/crate.tscn" id="5_u8rgi"]
[ext_resource type="PackedScene" uid="uid://5vkisovypn7u" path="res://scenes/coin.tscn" id="10_vh708"]
[ext_resource type="PackedScene" uid="uid://b07px1qf5obql" path="res://scenes/slimeEnemy.tscn" id="11_gnd6o"]
[ext_resource type="PackedScene" uid="uid://drnga68jb8frq" path="res://scenes/ui.tscn" id="11_k7pka"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_xg6qs"]
texture = ExtResource("2_l22q1")
@@ -527,7 +528,7 @@ metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="level/StaticBody2D"]
shape = SubResource("WorldBoundaryShape2D_3u4a8")
[node name="CharacterBody2D" parent="." groups=["player"] instance=ExtResource("2_64ccm")]
[node name="CharacterBody2D" parent="." instance=ExtResource("2_64ccm")]
position = Vector2(340, 90)
PUSH_FORCE = 550
@@ -594,9 +595,21 @@ position = Vector2(776, 21)
[node name="Area2D14" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(814, 20)
[node name="SlimeEnemy" parent="." instance=ExtResource("11_gnd6o")]
[node name="Enemies" type="Node" parent="."]
[node name="SlimeEnemy" parent="Enemies" instance=ExtResource("11_gnd6o")]
position = Vector2(125, 149)
[node name="SlimeEnemy2" parent="Enemies" instance=ExtResource("11_gnd6o")]
position = Vector2(-184, 52)
[node name="SlimeEnemy3" parent="Enemies" instance=ExtResource("11_gnd6o")]
position = Vector2(559, 84)
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Control" parent="CanvasLayer" instance=ExtResource("11_k7pka")]
[connection signal="timeout" from="GameController/Timer" to="GameController" method="resetWorld"]
[connection signal="areatrigger" from="AreaTrigger" to="GameController" method="_on_area_2d_areatrigger"]
[connection signal="body_entered" from="AreaTrigger" to="AreaTrigger" method="_on_body_entered"]
+31
View File
@@ -0,0 +1,31 @@
[gd_scene load_steps=2 format=3 uid="uid://drnga68jb8frq"]
[ext_resource type="Script" path="res://scripts/ui.gd" id="1_4c207"]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_4c207")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
[node name="Health" type="Label" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
text = "Health"
[node name="Coins" type="Label" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 10
text = "Coins"