greandes, dyanmic instantiation, statemachine

This commit is contained in:
torontocaper committed 2026-05-04 21:01:53 -04:00
1 parent 4dada35f76
commit ed9a99e192
17 files changed
+448 -25

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
[gd_scene format=3 uid="uid://bsroh4vsjwblh"]
[ext_resource type="Script" uid="uid://vwu0qtoxeqcn" path="res://Scripts/crate.gd" id="1_wp72f"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ebmjs"]
[node name="RigidBody2D" type="RigidBody2D" unique_id=2099388145 groups=["destructible"]]
rotation = -1.7350631
script = ExtResource("1_wp72f")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=414521394]
shape = SubResource("RectangleShape2D_ebmjs")
debug_color = Color(0.8238579, 0.39945692, 0.031017382, 0.41960785)
+15 -18
View File
@@ -1,8 +1,11 @@
[gd_scene format=3 uid="uid://bcisk0tho1stb"]
[ext_resource type="Script" uid="uid://b4efh8nwneqkf" path="res://Scripts/player.gd" id="1_ebmjs"]
[ext_resource type="Script" uid="uid://ctdwfmqkny8rc" path="res://Scripts/game controller.gd" id="1_qxrlw"]
[ext_resource type="PackedScene" uid="uid://bsroh4vsjwblh" path="res://Scenes/crate.tscn" id="2_wowpa"]
[ext_resource type="PackedScene" uid="uid://dmk1mp1hqm62b" path="res://Scenes/player.tscn" id="3_i6g32"]
[ext_resource type="Script" uid="uid://kb3v21msvi17" path="res://Scripts/trigger.gd" id="3_wrm1d"]
[ext_resource type="PackedScene" uid="uid://ceyxo0mrrrd6d" path="res://Scenes/grenade.tscn" id="4_3dryh"]
[ext_resource type="Script" uid="uid://qhll446powxt" path="res://Scripts/scene_manager.gd" id="6_1l0tm"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2poj3"]
size = Vector2(82, 20)
@@ -11,14 +14,17 @@ size = Vector2(82, 20)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_2poj3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_2poj3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_3dryh"]
radius = 18.110771
[node name="Game" type="Node2D" unique_id=1323011736]
script = ExtResource("1_qxrlw")
[node name="SceneManager" type="Node2D" parent="." unique_id=711947929]
unique_name_in_owner = true
position = Vector2(-39, 148)
script = ExtResource("6_1l0tm")
[node name="platfrom" type="StaticBody2D" parent="." unique_id=446401574]
position = Vector2(399, 122)
constant_linear_velocity = Vector2(10, 0)
@@ -27,14 +33,8 @@ metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="platfrom" unique_id=1022493365]
shape = SubResource("RectangleShape2D_2poj3")
[node name="RigidBody2D" type="RigidBody2D" parent="." unique_id=193574446]
position = Vector2(360, 27.000004)
rotation = -1.7350631
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D" unique_id=73164979]
shape = SubResource("RectangleShape2D_ebmjs")
debug_color = Color(0.8238579, 0.39945692, 0.031017382, 0.41960785)
[node name="RigidBody2D" parent="." unique_id=2099388145 instance=ExtResource("2_wowpa")]
position = Vector2(331, 234)
[node name="RigidBody2D2" type="RigidBody2D" parent="." unique_id=1977575109]
position = Vector2(428.99997, 26)
@@ -52,14 +52,8 @@ metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=1935948289]
shape = SubResource("WorldBoundaryShape2D_2poj3")
[node name="CharacterBody2D" type="CharacterBody2D" parent="." unique_id=793835080]
[node name="Player" parent="." unique_id=872670144 instance=ExtResource("3_i6g32")]
position = Vector2(399, 75)
script = ExtResource("1_ebmjs")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D" unique_id=75435339]
shape = SubResource("CircleShape2D_2poj3")
debug_color = Color(0.25014314, 0.63459045, 0.102719225, 0.41960785)
[node name="Area2D" type="Area2D" parent="." unique_id=1630381885]
position = Vector2(447, 155)
@@ -70,5 +64,8 @@ metadata/_edit_group_ = true
shape = SubResource("CircleShape2D_3dryh")
debug_color = Color(0.77940935, 0.23498747, 0.906131, 0.41960785)
[node name="Grenade" parent="." unique_id=1054741787 instance=ExtResource("4_3dryh")]
position = Vector2(346, 91)
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
[connection signal="triggerActiveSignal" from="Area2D" to="." method="_on_triggerSignal"]
+17
View File
@@ -0,0 +1,17 @@
[gd_scene format=3 uid="uid://ceyxo0mrrrd6d"]
[ext_resource type="Script" uid="uid://86lxae5ujqvq" path="res://Scripts/grenade.gd" id="1_v44n1"]
[sub_resource type="CircleShape2D" id="CircleShape2D_wrm1d"]
radius = 12.88
[node name="Grenade" type="RigidBody2D" unique_id=1054741787]
contact_monitor = true
max_contacts_reported = 3
script = ExtResource("1_v44n1")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=560084486]
shape = SubResource("CircleShape2D_wrm1d")
debug_color = Color(0.8306428, 0.39345673, 0, 0.41960785)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+169
View File
@@ -0,0 +1,169 @@
[gd_scene format=3 uid="uid://dmk1mp1hqm62b"]
[ext_resource type="Script" uid="uid://b4efh8nwneqkf" path="res://Scripts/player.gd" id="1_v0iea"]
[ext_resource type="Texture2D" uid="uid://p72rbg7thsvi" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_cvnsp"]
[ext_resource type="Texture2D" uid="uid://b74hvan7k63nk" path="res://assets/graphics/player/Run/player run 48x48.png" id="3_6t5aa"]
[sub_resource type="CircleShape2D" id="CircleShape2D_2poj3"]
[sub_resource type="AtlasTexture" id="AtlasTexture_6t5aa"]
atlas = ExtResource("2_cvnsp")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_vgqql"]
atlas = ExtResource("2_cvnsp")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_fkybt"]
atlas = ExtResource("2_cvnsp")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_x3wgy"]
atlas = ExtResource("2_cvnsp")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_3smsa"]
atlas = ExtResource("2_cvnsp")
region = Rect2(192, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_8erm5"]
atlas = ExtResource("2_cvnsp")
region = Rect2(240, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_f1ek2"]
atlas = ExtResource("2_cvnsp")
region = Rect2(288, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_tx1dd"]
atlas = ExtResource("2_cvnsp")
region = Rect2(336, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_gymyn"]
atlas = ExtResource("2_cvnsp")
region = Rect2(384, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_pu2lt"]
atlas = ExtResource("2_cvnsp")
region = Rect2(432, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ukyrk"]
atlas = ExtResource("3_6t5aa")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_7dp3o"]
atlas = ExtResource("3_6t5aa")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_h4iuc"]
atlas = ExtResource("3_6t5aa")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_fd4e3"]
atlas = ExtResource("3_6t5aa")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_qqcod"]
atlas = ExtResource("3_6t5aa")
region = Rect2(192, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_igrcy"]
atlas = ExtResource("3_6t5aa")
region = Rect2(240, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_fs7ks"]
atlas = ExtResource("3_6t5aa")
region = Rect2(288, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_l6n3p"]
atlas = ExtResource("3_6t5aa")
region = Rect2(336, 0, 48, 48)
[sub_resource type="SpriteFrames" id="SpriteFrames_ukyrk"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6t5aa")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vgqql")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fkybt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x3wgy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3smsa")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8erm5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f1ek2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tx1dd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gymyn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pu2lt")
}],
"loop": true,
"name": &"idle",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ukyrk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7dp3o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h4iuc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fd4e3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qqcod")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_igrcy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fs7ks")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l6n3p")
}],
"loop": true,
"name": &"run",
"speed": 12.0
}]
[node name="Player" type="CharacterBody2D" unique_id=872670144]
script = ExtResource("1_v0iea")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=894201673]
shape = SubResource("CircleShape2D_2poj3")
debug_color = Color(0.25014314, 0.63459045, 0.102719225, 0.41960785)
[node name="RightSpawn" type="Marker2D" parent="." unique_id=320859586]
position = Vector2(10, -8)
[node name="LeftSpawn" type="Marker2D" parent="." unique_id=2027988010]
position = Vector2(-17, -8)
[node name="PlayerGraphic" type="AnimatedSprite2D" parent="." unique_id=867519932]
texture_filter = 1
position = Vector2(0, -6)
sprite_frames = SubResource("SpriteFrames_ukyrk")
animation = &"run"
autoplay = "idle"
frame = 1
frame_progress = 0.18516552