week 2: force push and bullets!

This commit is contained in:
christophe committed 2025-08-11 21:03:09 -04:00
1 parent 3e8d5754f9
commit 0968ee75ae
13 files changed
+207 -45

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=3 uid="uid://dmhto2dvjub1j"]
[ext_resource type="Script" uid="uid://do4exob6g0cfd" path="res://scripts/bullet.gd" id="1_mkf8s"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_h1aey"]
radius = 1.99136
height = 17.9993
[node name="Area2D" type="Area2D"]
script = ExtResource("1_mkf8s")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.57936
shape = SubResource("CapsuleShape2D_h1aey")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="bulletHitSignal" from="." to="." method="_on_bullet_hit_signal"]
+14
View File
@@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=3 uid="uid://by6fag0gnv0r4"]
[ext_resource type="Script" uid="uid://boay68qas1gpa" path="res://scripts/crate.gd" id="1_b66cd"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"]
[node name="crate" type="RigidBody2D" groups=["shootable", "shovable"]]
rotation = -0.698132
script = ExtResource("1_b66cd")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_uwrxv")
debug_color = Color(0.841123, 0.368839, 0.275526, 0.42)
+13 -30
View File
@@ -1,21 +1,23 @@
[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="Script" uid="uid://vi7u52xttkpb" path="res://scripts/scene_manager.gd" id="2_iywne"]
[ext_resource type="PackedScene" uid="uid://by6fag0gnv0r4" path="res://scenes/crate.tscn" id="2_lbhrr"]
[ext_resource type="PackedScene" uid="uid://d4db6ttyltd56" path="res://scenes/player.tscn" id="2_lnu2h"]
[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="SceneManager" type="Node2D" parent="."]
unique_name_in_owner = true
script = ExtResource("2_iywne")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
position = Vector2(498, 356)
metadata/_edit_group_ = true
@@ -23,23 +25,11 @@ 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="crate" parent="." instance=ExtResource("2_lbhrr")]
position = Vector2(530, 267)
[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="crate2" parent="." instance=ExtResource("2_lbhrr")]
position = Vector2(769, 273)
[node name="ground" type="StaticBody2D" parent="."]
position = Vector2(485, 460)
@@ -48,17 +38,10 @@ metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="ground"]
shape = SubResource("WorldBoundaryShape2D_8cj0n")
[node name="player" type="CharacterBody2D" parent="."]
[node name="player" parent="." instance=ExtResource("2_lnu2h")]
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)
position = Vector2(494, 403)
[connection signal="areaTriggerSignal" from="Area2D" to="." method="_on_trigger"]
+25
View File
@@ -0,0 +1,25 @@
[gd_scene load_steps=3 format=3 uid="uid://d4db6ttyltd56"]
[ext_resource type="Script" uid="uid://bg8hstdeqf43x" path="res://scripts/player.gd" id="1_3vyb7"]
[sub_resource type="CircleShape2D" id="CircleShape2D_8cj0n"]
[node name="player" type="CharacterBody2D"]
script = ExtResource("1_3vyb7")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_8cj0n")
debug_color = Color(0.285278, 0.619884, 0.338524, 0.42)
[node name="RightCast" type="RayCast2D" parent="."]
target_position = Vector2(64, 0)
[node name="LeftCast" type="RayCast2D" parent="."]
target_position = Vector2(-45, 0)
[node name="RightSpawn" type="Node2D" parent="."]
position = Vector2(16, -3)
[node name="LeftSpawn" type="Node2D" parent="."]
position = Vector2(-20, -3)