diff --git a/Root.tscn b/Root.tscn index d756487..88ae877 100644 --- a/Root.tscn +++ b/Root.tscn @@ -19,6 +19,7 @@ [ext_resource type="PackedScene" uid="uid://mahsivqsy3oo" path="res://obstacles/panchina.tscn" id="18_ijdrl"] [ext_resource type="PackedScene" uid="uid://ca6gyhifgdnks" path="res://models/bar.glb" id="19_c0gkt"] [ext_resource type="PackedScene" uid="uid://c1p6udf66lht2" path="res://obstacles/bullet.tscn" id="19_fskgs"] +[ext_resource type="PackedScene" uid="uid://c8ey6yaaj70kw" path="res://obstacles/bullet_ball.tscn" id="19_u5bb2"] [sub_resource type="Theme" id="Theme_hkcet"] Label/fonts/font = ExtResource("3_p3wyc") diff --git a/Torretta.gd b/Torretta.gd index f5b8468..45760d6 100644 --- a/Torretta.gd +++ b/Torretta.gd @@ -7,7 +7,7 @@ extends StaticBody3D @export var rotation_speed = 0.1 @export var initial_cooldown: float = 0.2 -var bullet = preload("res://obstacles/bullet.tscn") +@export var bullet = preload("res://obstacles/bullet.tscn") var cooldown = 0 # Called when the node enters the scene tree for the first time. diff --git a/obstacles/bullet_ball.tscn b/obstacles/bullet_ball.tscn new file mode 100644 index 0000000..8a5dde7 --- /dev/null +++ b/obstacles/bullet_ball.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=4 format=3 uid="uid://c8ey6yaaj70kw"] + +[ext_resource type="Script" path="res://obstacles/bullet.gd" id="1_igsmj"] +[ext_resource type="PackedScene" uid="uid://c3g6lxikgfr7e" path="res://models/balla.glb" id="2_48nmr"] + +[sub_resource type="SphereShape3D" id="SphereShape3D_c6uuh"] +radius = 0.435146 + +[node name="Bullet" type="RigidBody3D"] +transform = Transform3D(-4.37114e-08, 1, 4.37114e-08, 0, -4.37114e-08, 1, 1, 4.37114e-08, 1.91069e-15, 0, 0, 0) +collision_layer = 4 +collision_mask = 4 +gravity_scale = 0.0 +continuous_cd = true +max_contacts_reported = 1 +contact_monitor = true +script = ExtResource("1_igsmj") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, -4.6454e-15, 6.92218e-22, 4.6454e-15, 1, -3.4244e-15, -6.92218e-22, 3.4244e-15, 1, 0, 0, 0) +shape = SubResource("SphereShape3D_c6uuh") + +[node name="balla" parent="." instance=ExtResource("2_48nmr")] +transform = Transform3D(0.427778, 0, -1.05879e-22, 0, 0.427778, 3.57275e-23, -1.05879e-22, 3.57275e-23, 0.427778, 0, 0, 0) + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/obstacles/torretta.tscn b/obstacles/torretta.tscn index 6817abf..e99ffb8 100644 --- a/obstacles/torretta.tscn +++ b/obstacles/torretta.tscn @@ -7,7 +7,6 @@ size = Vector3(1.9188, 3.57475, 2.31203) [node name="Torretta" type="StaticBody3D"] -transform = Transform3D(-0.810819, 0, 0.585297, 0, 1, 0, -0.585297, 0, -0.810819, 0, 0, 0) script = ExtResource("1_wqejx") initial_cooldown = 0.5 @@ -17,5 +16,3 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.09828, 0) shape = SubResource("BoxShape3D_hwxik") - -[node name="RayCast3D" type="RayCast3D" parent="."]