week1 - collisions

This commit is contained in:
nakurai committed 2025-07-28 21:08:53 -04:00
commit 3e8d5754f9
14 files changed
+207

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
[gd_scene load_steps=8 format=3 uid="uid://dk3bbsqf7yi08"]
[ext_resource type="Script" uid="uid://c3o8iur48idhr" path="res://scripts/gamecontroller.gd" id="1_lnu2h"]
[ext_resource type="Script" uid="uid://bg8hstdeqf43x" path="res://scripts/player.gd" id="1_uwrxv"]
[ext_resource type="PackedScene" uid="uid://e5y4obsl2kcv" path="res://scenes/trigger.tscn" id="2_yqjtg"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8cj0n"]
size = Vector2(144, 20)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"]
[sub_resource type="CircleShape2D" id="CircleShape2D_8cj0n"]
[node name="game" type="Node2D"]
script = ExtResource("1_lnu2h")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
position = Vector2(498, 356)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource("RectangleShape2D_8cj0n")
[node name="RigidBody2D" type="RigidBody2D" parent="."]
position = Vector2(475, 269)
rotation = -0.698132
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
shape = SubResource("RectangleShape2D_uwrxv")
debug_color = Color(0.841123, 0.368839, 0.275526, 0.42)
[node name="RigidBody2D2" type="RigidBody2D" parent="."]
position = Vector2(856, 194)
rotation = -0.698132
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D2"]
shape = SubResource("RectangleShape2D_uwrxv")
debug_color = Color(0.841123, 0.368839, 0.275526, 0.42)
[node name="ground" type="StaticBody2D" parent="."]
position = Vector2(485, 460)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="ground"]
shape = SubResource("WorldBoundaryShape2D_8cj0n")
[node name="player" type="CharacterBody2D" parent="."]
position = Vector2(472, 333)
script = ExtResource("1_uwrxv")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="player"]
shape = SubResource("CircleShape2D_8cj0n")
debug_color = Color(0.285278, 0.619884, 0.338524, 0.42)
[node name="Area2D" parent="." instance=ExtResource("2_yqjtg")]
position = Vector2(851, 421)
scale = Vector2(3.02324, 2.78272)
[connection signal="areaTriggerSignal" from="Area2D" to="." method="_on_trigger"]
+17
View File
@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=3 uid="uid://e5y4obsl2kcv"]
[ext_resource type="Script" uid="uid://ce32s4sac7kf0" path="res://scripts/trigger.gd" id="1_du5ex"]
[sub_resource type="CircleShape2D" id="CircleShape2D_uwrxv"]
[node name="trigger" type="Area2D"]
scale = Vector2(3.02324, 2.78272)
script = ExtResource("1_du5ex")
effect = "destroy"
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_uwrxv")
debug_color = Color(0.525515, 0.426125, 0.975229, 0.42)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]