1
Fork 0
mirror of https://github.com/Steffo99/cinnos.git synced 2024-11-29 03:24:21 +00:00
This commit is contained in:
Lorenzo Rossi 2023-11-25 20:12:19 +01:00
commit 92c66203a8
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 43733C54D7B7BD75
8 changed files with 101 additions and 21 deletions

View file

@ -3,6 +3,8 @@
[ext_resource type="Script" path="res://Player.gd" id="1_wt4gx"] [ext_resource type="Script" path="res://Player.gd" id="1_wt4gx"]
[ext_resource type="Material" uid="uid://dondfiavgo2ws" path="res://Unshaded.material" id="2_upp15"] [ext_resource type="Material" uid="uid://dondfiavgo2ws" path="res://Unshaded.material" id="2_upp15"]
[ext_resource type="Texture2D" uid="uid://dw80e5ieh0upb" path="res://addons/bisio.png" id="3_27tel"] [ext_resource type="Texture2D" uid="uid://dw80e5ieh0upb" path="res://addons/bisio.png" id="3_27tel"]
[ext_resource type="Material" path="res://Unshaded.material" id="2_upp15"]
[ext_resource type="Texture2D" uid="uid://uogmi4pvp64t" path="res://addons/bisio.png" id="3_27tel"]
[ext_resource type="FontFile" uid="uid://cseshyj4yw2f5" path="res://fonts/FiraSans-Medium.ttf" id="3_p3wyc"] [ext_resource type="FontFile" uid="uid://cseshyj4yw2f5" path="res://fonts/FiraSans-Medium.ttf" id="3_p3wyc"]
[ext_resource type="Script" path="res://GameTimer.gd" id="3_y362g"] [ext_resource type="Script" path="res://GameTimer.gd" id="3_y362g"]
[ext_resource type="Script" path="res://TextBox.gd" id="4_gpkq6"] [ext_resource type="Script" path="res://TextBox.gd" id="4_gpkq6"]
@ -19,6 +21,13 @@
[ext_resource type="PackedScene" path="res://obstacles/vent.tscn" id="15_hwvsi"] [ext_resource type="PackedScene" path="res://obstacles/vent.tscn" id="15_hwvsi"]
[ext_resource type="PackedScene" uid="uid://t0gblqb4yr8m" path="res://models/turret.glb" id="16_upw73"] [ext_resource type="PackedScene" uid="uid://t0gblqb4yr8m" path="res://models/turret.glb" id="16_upw73"]
[ext_resource type="PackedScene" uid="uid://ca6gyhifgdnks" path="res://models/bar.glb" id="19_c0gkt"] [ext_resource type="PackedScene" uid="uid://ca6gyhifgdnks" path="res://models/bar.glb" id="19_c0gkt"]
[ext_resource type="PlaneMesh" uid="uid://jy4q18wf2j41" path="res://road_mesh_something.tres" id="10_7jwjs"]
[ext_resource type="Texture2D" uid="uid://bx05lcriqc602" path="res://addons/asphalt_blank.png" id="11_kxmgb"]
[ext_resource type="PackedScene" path="res://obstacles/goal_billboard.tscn" id="14_0ikhl"]
[ext_resource type="PackedScene" path="res://obstacles/vent.tscn" id="15_hwvsi"]
[ext_resource type="PackedScene" uid="uid://cbmkrd5kwiujt" path="res://obstacles/torretta.tscn" id="17_6hms3"]
[ext_resource type="PackedScene" uid="uid://mahsivqsy3oo" path="res://obstacles/panchina.tscn" id="18_ijdrl"]
[ext_resource type="PackedScene" uid="uid://c1p6udf66lht2" path="res://obstacles/bullet.tscn" id="19_fskgs"]
[sub_resource type="Theme" id="Theme_hkcet"] [sub_resource type="Theme" id="Theme_hkcet"]
Label/fonts/font = ExtResource("3_p3wyc") Label/fonts/font = ExtResource("3_p3wyc")
@ -72,9 +81,6 @@ item/3/shapes = []
item/3/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) item/3/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
item/3/navigation_layers = 1 item/3/navigation_layers = 1
[sub_resource type="BoxShape3D" id="BoxShape3D_hwxik"]
size = Vector3(1.9188, 3.57475, 2.31203)
[node name="Root" type="Node3D"] [node name="Root" type="Node3D"]
[node name="UI" type="Control" parent="."] [node name="UI" type="Control" parent="."]
@ -265,14 +271,13 @@ transform = Transform3D(4, 0, 0, 0, 4, 0, 0, 0, 4, 168.103, 0, 8.66797)
[node name="Torretta" type="StaticBody3D" parent="."] [node name="Torretta" type="StaticBody3D" parent="."]
transform = Transform3D(-0.810819, 0, 0.585297, 0, 1, 0, -0.585297, 0, -0.810819, 479.543, 0.928251, 317.357) transform = Transform3D(-0.810819, 0, 0.585297, 0, 1, 0, -0.585297, 0, -0.810819, 479.543, 0.928251, 317.357)
script = ExtResource("15_058li") script = ExtResource("15_058li")
[node name="Panchina" parent="." instance=ExtResource("18_ijdrl")]
[node name="turret" parent="Torretta" instance=ExtResource("16_upw73")] [node name="Torretta" parent="." instance=ExtResource("17_6hms3")]
transform = Transform3D(-0.810819, 0, 0.585297, 0, 1, 0, -0.585297, 0, -0.810819, -5.62694, 0, -13.6183)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Torretta"] [node name="Bullet" parent="." instance=ExtResource("19_fskgs")]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 0, 1.09828, 0) transform = Transform3D(-4.37114e-08, 1, 4.37114e-08, 0, -4.37114e-08, 1, 1, 4.37114e-08, 1.91069e-15, -11.0235, 0, 14.2821)
shape = SubResource("BoxShape3D_hwxik")
[node name="RayCast3D" type="RayCast3D" parent="Torretta"]
[node name="bar" parent="." instance=ExtResource("19_c0gkt")] [node name="bar" parent="." instance=ExtResource("19_c0gkt")]
transform = Transform3D(-5.96046e-08, 0, -1, 0, 1, 0, 1, 0, -5.96046e-08, -15, 4, -22) transform = Transform3D(-5.96046e-08, 0, -1, 0, 1, 0, 1, 0, -5.96046e-08, -15, 4, -22)

View file

@ -5,7 +5,7 @@ extends StaticBody3D
@export var max_distance: float = 30.0 @export var max_distance: float = 30.0
@export var rotation_speed = 0.1 @export var rotation_speed = 0.1
@export var initial_cooldown: float = 0.1 @export var initial_cooldown: float = 0.2
var bullet = preload("res://obstacles/bullet.tscn") var bullet = preload("res://obstacles/bullet.tscn")
var cooldown = 0 var cooldown = 0
@ -26,7 +26,6 @@ func _physics_process(delta):
cooldown -= delta cooldown -= delta
else: else:
var bull = bullet.instantiate() var bull = bullet.instantiate()
bull.global_position = global_position
var diff_x = player.global_position.x - global_position.x var diff_x = player.global_position.x - global_position.x
var diff_z = player.global_position.z - global_position.z var diff_z = player.global_position.z - global_position.z
@ -34,9 +33,12 @@ func _physics_process(delta):
var diff = Vector3(diff_x, 0, diff_z) var diff = Vector3(diff_x, 0, diff_z)
var norm = diff.normalized() var norm = diff.normalized()
bull.position = global_position
bull.set_linear_velocity(norm * 50) bull.set_linear_velocity(norm * 50)
bull.rotation.y = diff.signed_angle_to(Vector3.FORWARD, Vector3.DOWN)
get_tree().root.find_child("Root", true, false).add_child(bull)
get_tree().root.add_child(bull)
cooldown = initial_cooldown cooldown = initial_cooldown

View file

@ -1,15 +1,14 @@
[gd_scene load_steps=4 format=3 uid="uid://c1p6udf66lht2"] [gd_scene load_steps=4 format=3 uid="uid://c1p6udf66lht2"]
[ext_resource type="Script" path="res://obstacles/bullet.gd" id="1_dawle"] [ext_resource type="Script" path="res://obstacles/bullet.gd" id="1_dawle"]
[ext_resource type="PackedScene" uid="uid://cis3y8bj1x60j" path="res://models/can.glb" id="2_jdw1w"]
[sub_resource type="CylinderMesh" id="CylinderMesh_nnt0g"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_rk7k5"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_rk7k5"]
radius = 0.58729 radius = 0.58729
[node name="Bullet" type="RigidBody3D"] [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) 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 = 0 collision_layer = 4
collision_mask = 4 collision_mask = 4
gravity_scale = 0.0 gravity_scale = 0.0
continuous_cd = true continuous_cd = true
@ -17,12 +16,11 @@ max_contacts_reported = 1
contact_monitor = true contact_monitor = true
script = ExtResource("1_dawle") script = ExtResource("1_dawle")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(0.4, 0, 0, 0, 0.4, 0, 0, 0, 0.4, 0, 0, 0)
mesh = SubResource("CylinderMesh_nnt0g")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] [node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(0.4, 0, 0, 0, 0.4, -3.34074e-23, 0, 3.34074e-23, 0.4, 0, 0, 0) transform = Transform3D(0.488, 0, 2.90929e-22, 0, 0.331, 0, -2.90929e-22, 0, 0.488, 0, 0, 0)
shape = SubResource("CylinderShape3D_rk7k5") shape = SubResource("CylinderShape3D_rk7k5")
[node name="can" parent="." instance=ExtResource("2_jdw1w")]
transform = Transform3D(0.267232, 8.88178e-16, -5.29396e-23, -8.88178e-16, 0.267232, 8.88178e-16, -2.11758e-22, -8.88178e-16, 0.267232, 0, 0, 0)
[connection signal="body_entered" from="." to="." method="_on_body_entered"] [connection signal="body_entered" from="." to="." method="_on_body_entered"]

17
obstacles/panchina.tscn Normal file
View file

@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=3 uid="uid://mahsivqsy3oo"]
[ext_resource type="PackedScene" uid="uid://ci3oqjm7d6n5c" path="res://models/veci.glb" id="1_5rsr2"]
[sub_resource type="BoxShape3D" id="BoxShape3D_5q6jj"]
size = Vector3(7.427, 3.83, 3.989)
[node name="Panchina" type="StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.9953, -1.41734, 0.942567)
collision_layer = 5
collision_mask = 5
[node name="veci" parent="." instance=ExtResource("1_5rsr2")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.54723, 2.53125, -0.928533)
shape = SubResource("BoxShape3D_5q6jj")

20
obstacles/torretta.tscn Normal file
View file

@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://cbmkrd5kwiujt"]
[ext_resource type="Script" path="res://Torretta.gd" id="1_wqejx"]
[ext_resource type="PackedScene" uid="uid://t0gblqb4yr8m" path="res://models/turret.glb" id="2_m7e8h"]
[sub_resource type="BoxShape3D" id="BoxShape3D_hwxik"]
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, -11.1919, 0.928251, 6.08668)
script = ExtResource("1_wqejx")
initial_cooldown = 0.5
[node name="turret" parent="." instance=ExtResource("2_m7e8h")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 0, 1.09828, 0)
shape = SubResource("BoxShape3D_hwxik")
[node name="RayCast3D" type="RayCast3D" parent="."]

View file

@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://ds01yl3tf0tva"]
[ext_resource type="Script" path="res://Torretta.gd" id="1_6tulh"]
[ext_resource type="PackedScene" uid="uid://t0gblqb4yr8m" path="res://models/turret.glb" id="2_64e5x"]
[sub_resource type="BoxShape3D" id="BoxShape3D_hwxik"]
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, -11.1919, 0.928251, 6.08668)
script = ExtResource("1_6tulh")
[node name="turret" parent="." instance=ExtResource("2_64e5x")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 0, 1.09828, 0)
shape = SubResource("BoxShape3D_hwxik")
[node name="RayCast3D" type="RayCast3D" parent="."]

19
torretta.tscn Normal file
View file

@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://lnbogqv7l2q4"]
[ext_resource type="Script" path="res://Torretta.gd" id="1_vcetf"]
[ext_resource type="PackedScene" uid="uid://t0gblqb4yr8m" path="res://models/turret.glb" id="2_6xcje"]
[sub_resource type="BoxShape3D" id="BoxShape3D_hwxik"]
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, -11.1919, 0.928251, 6.08668)
script = ExtResource("1_vcetf")
[node name="turret" parent="." instance=ExtResource("2_6xcje")]
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 0, 1.09828, 0)
shape = SubResource("BoxShape3D_hwxik")
[node name="RayCast3D" type="RayCast3D" parent="."]