From d9851b65cf1a69511655693d8ca9ca71275d1ca4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 25 Nov 2023 18:36:17 +0100 Subject: [PATCH 1/3] errestd6fjcyugfhyugyigyuohnkl --- Root.tscn | 20 +++++++++++++--- Trampolino.gd | 2 +- addons/asphalt_blank.png | Bin 0 -> 8257 bytes addons/asphalt_blank.png.import | 35 ++++++++++++++++++++++++++++ models/gratta.glb.import | 2 +- models/vent.tscn | 15 ------------ obstacles/vent.tscn | 39 ++++++++++++++++++++++++++++++++ road_mesh_something.tres | 4 ++-- 8 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 addons/asphalt_blank.png create mode 100644 addons/asphalt_blank.png.import delete mode 100644 models/vent.tscn create mode 100644 obstacles/vent.tscn diff --git a/Root.tscn b/Root.tscn index eff0c5f..09d5a6d 100644 --- a/Root.tscn +++ b/Root.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=25 format=3 uid="uid://4whij2hmts0t"] +[gd_scene load_steps=28 format=3 uid="uid://4whij2hmts0t"] [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"] @@ -13,8 +13,9 @@ [ext_resource type="PackedScene" uid="uid://bxj354o6rycsf" path="res://obstacles/house_c.tscn" id="9_xyam4"] [ext_resource type="PackedScene" uid="uid://ccs202pcy4pce" path="res://obstacles/dialog.tscn" id="10_6ihn6"] [ext_resource type="PlaneMesh" uid="uid://b2jhvncq5j8pe" 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" uid="uid://d3ikq1a6muafo" path="res://obstacles/goal_billboard.tscn" id="14_0ikhl"] -[ext_resource type="PackedScene" uid="uid://crbal5m8uhcd5" path="res://models/vent.tscn" id="15_hwvsi"] +[ext_resource type="PackedScene" uid="uid://crbal5m8uhcd5" path="res://obstacles/vent.tscn" id="15_hwvsi"] [sub_resource type="Theme" id="Theme_hkcet"] Label/fonts/font = ExtResource("3_p3wyc") @@ -42,6 +43,12 @@ albedo_texture = ExtResource("9_i8cb1") [sub_resource type="PlaneMesh" id="PlaneMesh_jacs4"] 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"] item/0/name = "Grass" item/0/mesh = SubResource("PlaneMesh_jacs4") @@ -55,6 +62,12 @@ item/1/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) item/1/shapes = [] item/1/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) 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 [node name="Root" type="Node3D"] @@ -188,7 +201,7 @@ mesh_library = SubResource("MeshLibrary_hklma") cell_size = Vector3(16, 2, 16) cell_scale = 8.0 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")] @@ -232,5 +245,6 @@ text = "tre" duration = 1.0 [node name="Vent" parent="." instance=ExtResource("15_hwvsi")] +transform = Transform3D(4, 0, 0, 0, 4, 0, 0, 0, 4, -2.89718, 0, 8.66797) [connection signal="timeout" from="UI/TextBox/Timer" to="UI/TextBox" method="_on_timer_timeout"] diff --git a/Trampolino.gd b/Trampolino.gd index cdb7252..e8e2271 100644 --- a/Trampolino.gd +++ b/Trampolino.gd @@ -8,4 +8,4 @@ class_name Trampolino func _on_body_entered(body): if body is Player: body.velocity.y += power - queue_free() + $Coll/Part.emitting = true diff --git a/addons/asphalt_blank.png b/addons/asphalt_blank.png new file mode 100644 index 0000000000000000000000000000000000000000..1d793e51ce69c5593cb30de1585c603eda457484 GIT binary patch literal 8257 zcmeHMd010NyPpuk5`l__MG6ukXaECAAOs?4P@)D6vIh{*5CVi95*ATu1Xt=(5nNc> z7!7++R79|d`_>{mSP-czTm2|1T4>cfC%ET#ok)ojn@1l&1mjGaif&g{|n{5R&VA~7;P^tih*uaANtgeDW z12k;Qg+&LY0%pPIVOVCtcElbjMktK(Spn-`zOSExb>e#)WIP3q)rQXoSg5d$gU_3= z2zN}+dk@xe5KKe)vn*M_6AQxeX+m)neg&K33I4DIU@f%y@I)H%R2vG}#?ApElBsqK z3WY(X;VF&`I|_qB1}b2Ct~!_l$4tS3l73n*eEoR+btX;l7EG@R;r2lngy08VkopH* zw!=F5Jx@ekwa@B$pYcbjOk?gw#=fr?A=1NZn)AE6?|ud|-IueM!-)`K;q6@?SOzrI z)YR258tUrmnwlC|Eu6O2j2T*UX3hQrXJTYJ*Tl%!7;kQ~08dyr&)Aqqw_Hf3*xTEi zE^u;jq&nN!*;5e^l%}Sp)(kB}ZEZuUnXwu5Z(r{&0$mMcO=uJWsOX~5x~O+ofhk-k z2Bo~Fslay?v?@kTT|*N)0~*xMM3h3SsG>0#RaMx#8TJEJUCb;qimTdeFP=If2}j+s z|ER{ir8SrIyxV>?w+l}6*%gQTGojy~0w(eYg z!{sYiuU)@!^VaS5j?S*`p1VKwK6v=(@sp>6L&GEE&tJTpc=h_X$ti>v!t=v5&FsJN z(uKTKR8`Tc>Ig5CN*Y33R~2JMQJdxJrOr#5O`vYkz%AW>wC0lLJUj1S^}>?du=?iq z4=lzJYD#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@mfGD|2Xe*n>}RQ83vj#xgF9s!dmpVo{nPrUfq8rRVus20O-)zGS|@d` z{64B)U2Tg3Rz9SAu}d``Z_v3yX1<&wGb#k@1Jv%{zkl+U=xS2%wHI?W*8l*sm8^w6 z7?+I)|U7Y&ycl;89C{D9Cyp06Fox{8N{9BLd<%H%55F7MWWz!>#m%tI@RZJIZ!e>TB!ea^u)Vk z17nZI$92DcVtm5(M0)yfdnd!TaK63r!nvrp_`#z`jW4%6NWAM#cz%&lI1zUFK*PCxSz|(U>hOX(0If0%7eQ% zRJzf%jtL%l;r9P%mF*qaSDtl!a1`W&U9m-=*91-m*woCDT~AB<>S1F;h6&uf&i0XBv9?TP?0I;M>8iFp+stua zO_1VeN00jYvLs>Wt!&Ej3u7JO$*$!AUUhwOZPpcGeg@y}I42I6JaIp)&%sRVN_W3) zS?(_VgQ0h;!zP==Jt=HK*1fi&@TDCYWiw`(sU9iWAl}@LjrVBRl3%%17_jbIhrOH_ n)NNqW^5SMv(ev)(xHssir%5IDE1LMouP`>t!>xMh`mFx~rxZJ| literal 0 HcmV?d00001 diff --git a/addons/asphalt_blank.png.import b/addons/asphalt_blank.png.import new file mode 100644 index 0000000..8bfddfb --- /dev/null +++ b/addons/asphalt_blank.png.import @@ -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 diff --git a/models/gratta.glb.import b/models/gratta.glb.import index 80db832..afebe94 100644 --- a/models/gratta.glb.import +++ b/models/gratta.glb.import @@ -16,7 +16,7 @@ dest_files=["res://.godot/imported/gratta.glb-2b83ad38defac79425963aac0ab9b05d.s nodes/root_type="Node3D" nodes/root_name="Scene Root" nodes/apply_root_scale=true -nodes/root_scale=1.0 +nodes/root_scale=0.4 meshes/ensure_tangents=true meshes/generate_lods=true meshes/create_shadow_meshes=true diff --git a/models/vent.tscn b/models/vent.tscn deleted file mode 100644 index 300bbd5..0000000 --- a/models/vent.tscn +++ /dev/null @@ -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"] diff --git a/obstacles/vent.tscn b/obstacles/vent.tscn new file mode 100644 index 0000000..baca1f6 --- /dev/null +++ b/obstacles/vent.tscn @@ -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"] diff --git a/road_mesh_something.tres b/road_mesh_something.tres index 39aaa47..5238ac7 100644 --- a/road_mesh_something.tres +++ b/road_mesh_something.tres @@ -2,8 +2,8 @@ [ext_resource type="Texture2D" uid="uid://2cuubqxj75u6" 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") [resource] -material = SubResource("StandardMaterial3D_30fli") +material = SubResource("StandardMaterial3D_vlayp") From ab27c3f440e51d51034b15cedd4b2dc49c8df289 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 25 Nov 2023 18:49:48 +0100 Subject: [PATCH 2/3] asdiogrdiogeriog --- Torretta.gd | 12 ++++++++++-- bullet.gd | 11 ----------- obstacles/bullet.gd | 3 +-- obstacles/bullet.tscn | 6 +++++- 4 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 bullet.gd diff --git a/Torretta.gd b/Torretta.gd index 28f2283..dfcd042 100644 --- a/Torretta.gd +++ b/Torretta.gd @@ -5,6 +5,7 @@ extends StaticBody3D @export var max_distance: float = 30.0 @export var rotation_speed = 0.1 +@export var initial_cooldown: float = 0.1 var bullet = preload("res://obstacles/bullet.tscn") var cooldown = 0 @@ -26,10 +27,17 @@ func _physics_process(delta): else: var bull = bullet.instantiate() 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) - cooldown = 5 + cooldown = initial_cooldown diff --git a/bullet.gd b/bullet.gd deleted file mode 100644 index 92626b9..0000000 --- a/bullet.gd +++ /dev/null @@ -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 diff --git a/obstacles/bullet.gd b/obstacles/bullet.gd index a9380e1..b56b293 100644 --- a/obstacles/bullet.gd +++ b/obstacles/bullet.gd @@ -13,6 +13,5 @@ func _process(delta): func _on_body_entered(body): if body is Player: - body.velocity += (global_position - body.global_position).normalized() * 5 - print("AAAAAA") + body.velocity += (body.global_position - global_position).normalized() * 8 queue_free() diff --git a/obstacles/bullet.tscn b/obstacles/bullet.tscn index dc49d54..4148d1b 100644 --- a/obstacles/bullet.tscn +++ b/obstacles/bullet.tscn @@ -9,8 +9,12 @@ radius = 0.58729 [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_layer = 0 collision_mask = 4 +gravity_scale = 0.0 +continuous_cd = true +max_contacts_reported = 1 +contact_monitor = true script = ExtResource("1_dawle") [node name="MeshInstance3D" type="MeshInstance3D" parent="."] From 6ca013fc6de3f1523100d9e4e043ead107b186cf Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 25 Nov 2023 18:55:12 +0100 Subject: [PATCH 3/3] torr --- torretta.tscn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 torretta.tscn diff --git a/torretta.tscn b/torretta.tscn new file mode 100644 index 0000000..ba9054e --- /dev/null +++ b/torretta.tscn @@ -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="."]