raycasts, melee attack,factory for bullets , spawn points, dynamic instatiation

This commit is contained in:
JayisonDevadas committed 2025-08-11 21:08:57 -04:00
1 parent c8a99da3e1
commit 309f5f9941
11 files changed
+210 -48

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=3 uid="uid://lg8k51aicde4"]
[ext_resource type="Script" path="res://scripts/bullet.gd" id="1_bpcfw"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_oprgb"]
size = Vector2(8, 4)
[node name="Bullet" type="Area2D"]
script = ExtResource("1_bpcfw")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_oprgb")
debug_color = Color(0.866207, 0.326527, 0.373638, 0.42)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+14
View File
@@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=3 uid="uid://d0mw3eh00s3kr"]
[ext_resource type="Script" path="res://scripts/crate.gd" id="1_j2btj"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"]
[node name="Crate" type="RigidBody2D" groups=["pushables", "shootables"]]
rotation = 0.602841
script = ExtResource("1_j2btj")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_uwrxv")
debug_color = Color(0.820447, 0.391315, 0.259417, 0.42)
+21 -33
View File
@@ -1,21 +1,24 @@
[gd_scene load_steps=8 format=3 uid="uid://doctwh8lc63y5"]
[gd_scene load_steps=9 format=3 uid="uid://doctwh8lc63y5"]
[ext_resource type="Script" uid="uid://cpua8fr5bby78" path="res://scripts/gamecontroller.gd" id="1_lnu2h"]
[ext_resource type="Script" uid="uid://cnwga6l2btdbk" path="res://scripts/player.gd" id="1_uwrxv"]
[ext_resource type="Script" path="res://scripts/gamecontroller.gd" id="1_lnu2h"]
[ext_resource type="PackedScene" uid="uid://b5p1mlv4c1olv" path="res://scenes/player.tscn" id="2_5tj0f"]
[ext_resource type="Script" path="res://scripts/scene_manager.gd" id="2_w84c1"]
[ext_resource type="PackedScene" uid="uid://6n3305pqp43a" path="res://scenes/trigger.tscn" id="2_yqjtg"]
[ext_resource type="PackedScene" uid="uid://d0mw3eh00s3kr" path="res://scenes/crate.tscn" id="4_syc2o"]
[ext_resource type="PackedScene" uid="uid://lg8k51aicde4" path="res://scenes/bullet.tscn" id="5_3trti"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8cj0n"]
size = Vector2(52, 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_w84c1")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
position = Vector2(580, 413)
metadata/_edit_group_ = true
@@ -23,24 +26,6 @@ metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource("RectangleShape2D_8cj0n")
[node name="RigidBody2D" type="RigidBody2D" parent="."]
position = Vector2(594, 335)
rotation = 0.767945
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
shape = SubResource("RectangleShape2D_uwrxv")
debug_color = Color(0.820447, 0.391315, 0.259417, 0.42)
[node name="RigidBody2D2" type="RigidBody2D" parent="."]
position = Vector2(577, 256)
rotation = 0.602841
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D2"]
shape = SubResource("RectangleShape2D_uwrxv")
debug_color = Color(0.820447, 0.391315, 0.259417, 0.42)
[node name="ground" type="StaticBody2D" parent="."]
position = Vector2(583, 553)
metadata/_edit_group_ = true
@@ -48,16 +33,19 @@ metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="ground"]
shape = SubResource("WorldBoundaryShape2D_8cj0n")
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
position = Vector2(580, 392)
script = ExtResource("1_uwrxv")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
shape = SubResource("CircleShape2D_8cj0n")
debug_color = Color(0.256799, 0.626646, 0.294192, 0.42)
[node name="Player" parent="." instance=ExtResource("2_5tj0f")]
position = Vector2(580, 368)
[node name="Area2D" parent="." instance=ExtResource("2_yqjtg")]
position = Vector2(872, 521)
[node name="Crate" parent="." instance=ExtResource("4_syc2o")]
position = Vector2(592, 261)
[node name="trigger" parent="." instance=ExtResource("2_yqjtg")]
position = Vector2(389, 519)
[node name="Bullet" parent="." instance=ExtResource("5_3trti")]
position = Vector2(433, 332)
[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://b5p1mlv4c1olv"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_bqfhv"]
[sub_resource type="CircleShape2D" id="CircleShape2D_8cj0n"]
[node name="Player" type="CharacterBody2D"]
script = ExtResource("1_bqfhv")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_8cj0n")
debug_color = Color(0.256799, 0.626646, 0.294192, 0.42)
[node name="RightCast" type="RayCast2D" parent="."]
target_position = Vector2(21, 0)
[node name="LeftCast" type="RayCast2D" parent="."]
target_position = Vector2(-20, 0)
[node name="RightSpawn" type="Node2D" parent="."]
position = Vector2(12, -7)
[node name="LeftSpawn" type="Node2D" parent="."]
position = Vector2(-12, -7)
+1 -1
View File
@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://6n3305pqp43a"]
[ext_resource type="Script" uid="uid://c57chsew3r87y" path="res://scripts/trigger.gd" id="1_du5ex"]
[ext_resource type="Script" path="res://scripts/trigger.gd" id="1_du5ex"]
[sub_resource type="CircleShape2D" id="CircleShape2D_uwrxv"]