1
Fork 0
mirror of https://github.com/Steffo99/cinnos.git synced 2024-11-25 01:24:20 +00:00
This commit is contained in:
Leonardo 2023-11-25 19:05:15 +01:00
commit 7abfebb016
13 changed files with 134 additions and 42 deletions

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=29 format=3 uid="uid://4whij2hmts0t"] [gd_scene load_steps=31 format=3 uid="uid://4whij2hmts0t"]
[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" 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://uogmi4pvp64t" path="res://addons/bisio.png" id="3_27tel"] [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"]
@ -11,11 +11,12 @@
[ext_resource type="Script" path="res://Camera3D.gd" id="8_auifr"] [ext_resource type="Script" path="res://Camera3D.gd" id="8_auifr"]
[ext_resource type="Texture2D" uid="uid://ct6sngef76p35" path="res://addons/grass.png" id="9_i8cb1"] [ext_resource type="Texture2D" uid="uid://ct6sngef76p35" path="res://addons/grass.png" id="9_i8cb1"]
[ext_resource type="PackedScene" uid="uid://bxj354o6rycsf" path="res://obstacles/house_c.tscn" id="9_xyam4"] [ext_resource type="PackedScene" uid="uid://bxj354o6rycsf" path="res://obstacles/house_c.tscn" id="9_xyam4"]
[ext_resource type="PackedScene" path="res://obstacles/dialog.tscn" id="10_6ihn6"] [ext_resource type="PackedScene" uid="uid://ccs202pcy4pce" path="res://obstacles/dialog.tscn" id="10_6ihn6"]
[ext_resource type="PlaneMesh" uid="uid://jy4q18wf2j41" path="res://road_mesh_something.tres" id="10_7jwjs"] [ext_resource type="PlaneMesh" uid="uid://jy4q18wf2j41" uid="uid://jy4q18wf2j41" path="res://road_mesh_something.tres" id="10_7jwjs"]
[ext_resource type="PackedScene" path="res://obstacles/goal_billboard.tscn" id="14_0ikhl"] [ext_resource type="Texture2D" uid="uid://bx05lcriqc602" path="res://addons/asphalt_blank.png" id="11_kxmgb"]
[ext_resource type="PackedScene" uid="uid://d3ikq1a6muafo" path="res://obstacles/goal_billboard.tscn" id="14_0ikhl"]
[ext_resource type="Script" path="res://Torretta.gd" id="15_058li"] [ext_resource type="Script" path="res://Torretta.gd" id="15_058li"]
[ext_resource type="PackedScene" path="res://models/vent.tscn" id="15_hwvsi"] [ext_resource type="PackedScene" uid="uid://crbal5m8uhcd5" 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://mahsivqsy3oo" path="res://panchina.tscn" id="18_ijdrl"] [ext_resource type="PackedScene" uid="uid://mahsivqsy3oo" path="res://panchina.tscn" id="18_ijdrl"]
@ -45,6 +46,12 @@ albedo_texture = ExtResource("9_i8cb1")
[sub_resource type="PlaneMesh" id="PlaneMesh_jacs4"] [sub_resource type="PlaneMesh" id="PlaneMesh_jacs4"]
material = SubResource("StandardMaterial3D_ox173") material = SubResource("StandardMaterial3D_ox173")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gjt1j"]
albedo_texture = ExtResource("11_kxmgb")
[sub_resource type="PlaneMesh" id="PlaneMesh_at5n0"]
material = SubResource("StandardMaterial3D_gjt1j")
[sub_resource type="MeshLibrary" id="MeshLibrary_hklma"] [sub_resource type="MeshLibrary" id="MeshLibrary_hklma"]
item/0/name = "Grass" item/0/name = "Grass"
item/0/mesh = SubResource("PlaneMesh_jacs4") item/0/mesh = SubResource("PlaneMesh_jacs4")
@ -58,6 +65,12 @@ item/1/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
item/1/shapes = [] item/1/shapes = []
item/1/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) item/1/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
item/1/navigation_layers = 1 item/1/navigation_layers = 1
item/3/name = "AsphaltB"
item/3/mesh = SubResource("PlaneMesh_at5n0")
item/3/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
item/3/shapes = []
item/3/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
item/3/navigation_layers = 1
[sub_resource type="BoxShape3D" id="BoxShape3D_hwxik"] [sub_resource type="BoxShape3D" id="BoxShape3D_hwxik"]
size = Vector3(1.9188, 3.57475, 2.31203) size = Vector3(1.9188, 3.57475, 2.31203)
@ -197,7 +210,7 @@ mesh_library = SubResource("MeshLibrary_hklma")
cell_size = Vector3(16, 2, 16) cell_size = Vector3(16, 2, 16)
cell_scale = 8.0 cell_scale = 8.0
data = { data = {
"cells": PackedInt32Array(65533, 65535, 1, 65533, 0, 1) "cells": PackedInt32Array(65535, 65533, 1048576, 0, 65533, 1048576, 1, 65533, 1048576, 2, 65533, 1048576, 65534, 65533, 1048576, 65533, 65533, 1048576, 65532, 65534, 1048576, 65533, 65534, 1048576, 65533, 65535, 1048577, 65534, 0, 1048576, 65535, 0, 1048576, 0, 0, 1048576, 1, 0, 1048576, 2, 65535, 1048576, 2, 65534, 1048576, 1, 65532, 1048576, 0, 65532, 1048576, 65535, 65532, 1048576, 65532, 0, 1048576, 65532, 2, 1048576, 65533, 3, 1048576, 65534, 4, 1048576, 65535, 4, 1048576, 0, 3, 1048576, 2, 2, 1048576, 2, 0, 1048576, 65535, 65534, 1048576, 65533, 2, 1048576, 65534, 3, 1048576, 65534, 2, 1048576, 65535, 2, 1048576, 0, 65535, 1048576, 65534, 65534, 1048576, 65533, 0, 1048576, 65534, 1, 1048576, 0, 1, 1048576, 0, 65534, 1048576, 0, 2, 1048576, 1, 2, 1048576, 1, 1, 1048576, 1, 65535, 1048576, 1, 65534, 1048576, 65535, 3, 1048576, 65535, 65535, 1048576, 65535, 1, 1048576, 65534, 65535, 1048576, 65532, 65535, 1048577, 65532, 1, 1048577, 0, 4, 1048576, 1, 4, 1048576, 2, 3, 1048576, 3, 2, 1048576, 3, 1, 1048576, 3, 0, 1048576, 3, 65535, 1048576, 65531, 65535, 1048577, 65531, 0, 1048576, 65531, 1, 1048577, 65531, 2, 1048576, 1, 3, 1048576, 65532, 65533, 1048576, 2, 1, 1048576, 65533, 1, 1048577, 65531, 65533, 1048576, 65530, 65534, 1048576, 65529, 65535, 1048577, 65529, 0, 1048576, 65529, 1, 1048577, 65530, 2, 1048576, 65534, 65532, 1048576, 65533, 65532, 1048576, 65528, 0, 1048576, 65528, 1, 1048577, 65529, 2, 1048576, 65531, 65534, 1048576, 65530, 65535, 1048577, 65530, 0, 1048576, 65530, 1, 1048577, 65530, 65533, 1048576, 65529, 65534, 1048576, 65528, 2, 1048576, 65528, 3, 1048576, 65532, 65532, 1048576, 65531, 65532, 1048576, 65529, 65533, 1048576, 65528, 65534, 1048576, 65528, 65535, 1048577)
} }
[node name="Camera3D" type="Camera3D" parent="." node_paths=PackedStringArray("target")] [node name="Camera3D" type="Camera3D" parent="." node_paths=PackedStringArray("target")]
@ -245,6 +258,7 @@ text = "tre"
duration = 1.0 duration = 1.0
[node name="Vent" parent="." instance=ExtResource("15_hwvsi")] [node name="Vent" parent="." instance=ExtResource("15_hwvsi")]
transform = Transform3D(4, 0, 0, 0, 4, 0, 0, 0, 4, -2.89718, 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, -11.1919, 0.928251, 6.08668) transform = Transform3D(-0.810819, 0, 0.585297, 0, 1, 0, -0.585297, 0, -0.810819, -11.1919, 0.928251, 6.08668)

View file

@ -5,6 +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
var bullet = preload("res://obstacles/bullet.tscn") var bullet = preload("res://obstacles/bullet.tscn")
var cooldown = 0 var cooldown = 0
@ -26,10 +27,17 @@ func _physics_process(delta):
else: else:
var bull = bullet.instantiate() var bull = bullet.instantiate()
bull.global_position = global_position bull.global_position = global_position
bull.set_linear_velocity((player.global_position - global_position).normalized() * 50)
var diff_x = player.global_position.x - global_position.x
var diff_z = player.global_position.z - global_position.z
var diff = Vector3(diff_x, 0, diff_z)
var norm = diff.normalized()
bull.set_linear_velocity(norm * 50)
get_tree().root.add_child(bull) get_tree().root.add_child(bull)
cooldown = 5 cooldown = initial_cooldown

View file

@ -8,4 +8,4 @@ class_name Trampolino
func _on_body_entered(body): func _on_body_entered(body):
if body is Player: if body is Player:
body.velocity.y += power body.velocity.y += power
queue_free() $Coll/Part.emitting = true

BIN
addons/asphalt_blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bx05lcriqc602"
path.s3tc="res://.godot/imported/asphalt_blank.png-29c0bc03b38ba19f3b911a3b0fe49a67.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://addons/asphalt_blank.png"
dest_files=["res://.godot/imported/asphalt_blank.png-29c0bc03b38ba19f3b911a3b0fe49a67.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View file

@ -1,11 +0,0 @@
extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

View file

@ -16,7 +16,7 @@ dest_files=["res://.godot/imported/gratta.glb-2b83ad38defac79425963aac0ab9b05d.s
nodes/root_type="Node3D" nodes/root_type="Node3D"
nodes/root_name="Scene Root" nodes/root_name="Scene Root"
nodes/apply_root_scale=true nodes/apply_root_scale=true
nodes/root_scale=1.0 nodes/root_scale=0.4
meshes/ensure_tangents=true meshes/ensure_tangents=true
meshes/generate_lods=true meshes/generate_lods=true
meshes/create_shadow_meshes=true meshes/create_shadow_meshes=true

View file

@ -1,15 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://crbal5m8uhcd5"]
[ext_resource type="Script" path="res://Buccia.gd" id="1_v0c7a"]
[sub_resource type="BoxShape3D" id="BoxShape3D_p1ebg"]
size = Vector3(1.5, 0.5, 1.5)
[node name="Vent" type="Area3D"]
script = ExtResource("1_v0c7a")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0)
shape = SubResource("BoxShape3D_p1ebg")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View file

@ -13,6 +13,5 @@ func _process(delta):
func _on_body_entered(body): func _on_body_entered(body):
if body is Player: if body is Player:
body.velocity += (global_position - body.global_position).normalized() * 5 body.velocity += (body.global_position - global_position).normalized() * 8
print("AAAAAA")
queue_free() queue_free()

View file

@ -9,8 +9,12 @@ 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 = 4 collision_layer = 0
collision_mask = 4 collision_mask = 4
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1
contact_monitor = true
script = ExtResource("1_dawle") script = ExtResource("1_dawle")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."] [node name="MeshInstance3D" type="MeshInstance3D" parent="."]

39
obstacles/vent.tscn Normal file
View file

@ -0,0 +1,39 @@
[gd_scene load_steps=5 format=3 uid="uid://crbal5m8uhcd5"]
[ext_resource type="Script" path="res://Trampolino.gd" id="1_iup77"]
[ext_resource type="PackedScene" uid="uid://cl6ovgfaqn10a" path="res://models/gratta.glb" id="2_5etby"]
[sub_resource type="BoxShape3D" id="BoxShape3D_p1ebg"]
size = Vector3(1.31672, 0.16001, 1.05945)
[sub_resource type="BoxMesh" id="BoxMesh_eebns"]
size = Vector3(0.35, 0.35, 0.35)
[node name="Vent" type="Area3D"]
transform = Transform3D(4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0)
script = ExtResource("1_iup77")
power = 15.0
[node name="Coll" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00150687, 0.108682, 0.0586389)
shape = SubResource("BoxShape3D_p1ebg")
[node name="Part" type="CPUParticles3D" parent="Coll"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.147585, -0.0877324, -0.0586389)
emitting = false
amount = 50
one_shot = true
explosiveness = 1.0
randomness = 0.82
lifetime_randomness = 0.4
mesh = SubResource("BoxMesh_eebns")
emission_shape = 3
emission_box_extents = Vector3(0.7, 0.1, 0.7)
emission_colors = PackedColorArray(0.478431, 0.478431, 0.478431, 1, 1, 1, 1, 1, 0.686275, 0.686275, 0.686275, 1, 0.333333, 0.333333, 0.333333, 1)
gravity = Vector3(0, 9.8, 0)
scale_amount_max = 3.0
[node name="gratta" parent="." instance=ExtResource("2_5etby")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.146078, 0.410072, 0.192757)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View file

@ -2,8 +2,8 @@
[ext_resource type="Texture2D" uid="uid://cpbb24lnr0sf4" path="res://addons/asphalt.png" id="1_6yda2"] [ext_resource type="Texture2D" uid="uid://cpbb24lnr0sf4" path="res://addons/asphalt.png" id="1_6yda2"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_30fli"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vlayp"]
albedo_texture = ExtResource("1_6yda2") albedo_texture = ExtResource("1_6yda2")
[resource] [resource]
material = SubResource("StandardMaterial3D_30fli") material = SubResource("StandardMaterial3D_vlayp")

19
torretta.tscn Normal file
View file

@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://d0muettu1wwuw"]
[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="."]