static body, rigidbody, characterbody, trigger, custom signal, game controller

This commit is contained in:
OddlyTimbot committed 2026-03-02 21:00:36 -05:00
commit 76b6721c42
17 files changed
+251

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
[gd_scene format=3 uid="uid://b6lw2go5mwk3h"]
[ext_resource type="Script" uid="uid://p11f34oi5st7" path="res://scripts/crate.gd" id="1_b66cd"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"]
[node name="Crate" type="RigidBody2D" unique_id=1307809047]
rotation = 0.65698373
script = ExtResource("1_b66cd")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=511603323]
shape = SubResource("RectangleShape2D_uwrxv")
debug_color = Color(0.8327547, 0.384747, 0.1945984, 0.41960785)
+59
View File
@@ -0,0 +1,59 @@
[gd_scene format=3 uid="uid://cqk2rgy3m1chs"]
[ext_resource type="Script" uid="uid://dxubdt7nh5s1j" path="res://scripts/gameController.gd" id="1_lnu2h"]
[ext_resource type="PackedScene" uid="uid://b6lw2go5mwk3h" path="res://scenes/crate.tscn" id="2_lnu2h"]
[ext_resource type="Script" uid="uid://c17de7vvtri1e" path="res://scripts/player.gd" id="2_yqjtg"]
[ext_resource type="PackedScene" uid="uid://bf50mxdma8wq4" path="res://scenes/trigger.tscn" id="4_lbhrr"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8cj0n"]
size = Vector2(74, 20)
[sub_resource type="CircleShape2D" id="CircleShape2D_uwrxv"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_lbhrr"]
[node name="Game" type="Node2D" unique_id=239599901]
script = ExtResource("1_lnu2h")
[node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=2062716976]
position = Vector2(591, 442)
scale = Vector2(2, 1)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=1655047088]
shape = SubResource("RectangleShape2D_8cj0n")
[node name="Crate" parent="." unique_id=1307809047 instance=ExtResource("2_lnu2h")]
position = Vector2(644, 404)
[node name="Crate2" parent="." unique_id=1988562966 instance=ExtResource("2_lnu2h")]
position = Vector2(609, 403)
[node name="Player" type="CharacterBody2D" parent="." unique_id=1540403255]
position = Vector2(535, 417)
script = ExtResource("2_yqjtg")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player" unique_id=1365827185]
shape = SubResource("CircleShape2D_uwrxv")
debug_color = Color(0.28743955, 0.62438726, 0.25921708, 0.41960785)
[node name="Trigger" parent="." unique_id=1908774248 instance=ExtResource("4_lbhrr")]
position = Vector2(692, 509)
effect = "destroy"
[node name="Trigger2" parent="." unique_id=1627494044 instance=ExtResource("4_lbhrr")]
position = Vector2(508, 507)
[node name="StaticBody2D2" type="StaticBody2D" parent="." unique_id=426786591]
position = Vector2(601, 622)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2" unique_id=895098891]
shape = SubResource("WorldBoundaryShape2D_lbhrr")
[node name="Crate3" parent="." unique_id=1771442258 instance=ExtResource("2_lnu2h")]
position = Vector2(570, 397)
[connection signal="AreaTrigger" from="Trigger" to="." method="_on_trigger"]
[connection signal="AreaTrigger" from="Trigger2" to="." method="_on_trigger"]
+17
View File
@@ -0,0 +1,17 @@
[gd_scene format=3 uid="uid://bf50mxdma8wq4"]
[ext_resource type="Script" uid="uid://vtqy7n0vgxef" path="res://scripts/trigger.gd" id="1_du5ex"]
[sub_resource type="CircleShape2D" id="CircleShape2D_lbhrr"]
radius = 39.0
[node name="Trigger" type="Area2D" unique_id=1908774248]
script = ExtResource("1_du5ex")
effect = "bounce"
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1445918392]
shape = SubResource("CircleShape2D_lbhrr")
debug_color = Color(0.4051585, 0.47871065, 0.9689525, 0.41960785)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]