diff --git a/Module.tscn b/Module.tscn deleted file mode 100644 index fb3efd7..0000000 --- a/Module.tscn +++ /dev/null @@ -1,3 +0,0 @@ -[gd_scene load_steps=2 format=3] - -[ext_resource type="Script" path="res://scripts/Modules/Module.gd" id="1_42v8k"] diff --git a/Nodes/Player.tscn b/Nodes/Player.tscn index c55ae0e..43bd028 100644 --- a/Nodes/Player.tscn +++ b/Nodes/Player.tscn @@ -1,7 +1,23 @@ -[gd_scene load_steps=5 format=3 uid="uid://vwjd5od63jgh"] +[gd_scene load_steps=9 format=3 uid="uid://vwjd5od63jgh"] [ext_resource type="Script" path="res://scripts/Player.gd" id="1_dta8q"] +[ext_resource type="Texture2D" uid="uid://du7d6fk4dabd7" path="res://cVOQuID.png" id="2_pd1wl"] [ext_resource type="Texture2D" uid="uid://cy6x8d3xe8lux" path="res://icon.svg" id="2_yjfj7"] +[ext_resource type="Texture2D" uid="uid://eg0k8esm2scp" path="res://p5lFkJY.png" id="3_hxw38"] +[ext_resource type="Texture2D" uid="uid://dsphpbpt27t1i" path="res://a3TCqhg.png" id="4_6puyx"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_liykb"] +animations = [{ +"frames": [ExtResource("4_6puyx")], +"loop": true, +"name": &"idle", +"speed": 1.0 +}, { +"frames": [ExtResource("3_hxw38"), ExtResource("2_pd1wl")], +"loop": true, +"name": &"walking", +"speed": 2.0 +}] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_p76ml"] radius = 0.500599 @@ -13,14 +29,22 @@ radius = 0.567567 [node name="CharacterBody3D" type="CharacterBody3D"] script = ExtResource("1_dta8q") -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] -visible = false -shape = SubResource("CapsuleShape3D_p76ml") +[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."] +transform = Transform3D(0.3, 0, 0, 0, -1.31134e-08, 0.3, 0, -0.3, -1.31134e-08, 0, 1, 0) +frames = SubResource("SpriteFrames_liykb") +animation = &"idle" +speed_scale = 2.0 +playing = true [node name="Sprite3D" type="Sprite3D" parent="."] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 2, 0) +visible = false texture = ExtResource("2_yjfj7") +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +visible = false +shape = SubResource("CapsuleShape3D_p76ml") + [node name="HitBox" type="Area3D" parent="."] collision_mask = 5 diff --git a/Nodes/game.tscn b/Nodes/game.tscn index f8a0e42..20c50df 100644 --- a/Nodes/game.tscn +++ b/Nodes/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://n7w0ff7u25yc"] +[gd_scene load_steps=9 format=3 uid="uid://cp2itfdd21cg2"] [ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_iox18"] [ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="2_61aog"] @@ -48,7 +48,6 @@ transform = Transform3D(0.999998, 0, 0, 0, 1, 0, 0, 0, 0.999998, 12, 0, 0) script = ExtResource("2_xl0he") [node name="MeshInstance3D" type="MeshInstance3D" parent="Player2"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) mesh = SubResource("BoxMesh_ognqx") [node name="StaticBody3D" type="StaticBody3D" parent="Player2/MeshInstance3D"] @@ -58,7 +57,7 @@ transform = Transform3D(1, 8.23952e-25, 0, -1.6479e-25, 1, 0, 0, -1.65436e-24, 1 shape = SubResource("ConcavePolygonShape3D_l76gd") [node name="CharacterBody3D" parent="Player2" instance=ExtResource("4_1ipcp")] -transform = Transform3D(-0.0154457, -5.21527e-12, 0.999882, -6.75147e-10, 1, -5.21524e-12, -0.999882, -6.75146e-10, -0.0154457, 0, 0, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.258819, 0.965926, 0, -0.965926, 0.258819, 0, 0, 0) diff --git a/a3TCqhg.png b/a3TCqhg.png new file mode 100644 index 0000000..8bf19ae Binary files /dev/null and b/a3TCqhg.png differ diff --git a/a3TCqhg.png.import b/a3TCqhg.png.import new file mode 100644 index 0000000..2901b37 --- /dev/null +++ b/a3TCqhg.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dsphpbpt27t1i" +path.s3tc="res://.godot/imported/a3TCqhg.png-031224344752835081acfff9846aed1e.s3tc.ctex" +path.etc2="res://.godot/imported/a3TCqhg.png-031224344752835081acfff9846aed1e.etc2.ctex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://a3TCqhg.png" +dest_files=["res://.godot/imported/a3TCqhg.png-031224344752835081acfff9846aed1e.s3tc.ctex", "res://.godot/imported/a3TCqhg.png-031224344752835081acfff9846aed1e.etc2.ctex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +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/cVOQuID.png b/cVOQuID.png new file mode 100644 index 0000000..f10e108 Binary files /dev/null and b/cVOQuID.png differ diff --git a/cVOQuID.png.import b/cVOQuID.png.import new file mode 100644 index 0000000..3f43159 --- /dev/null +++ b/cVOQuID.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://du7d6fk4dabd7" +path.s3tc="res://.godot/imported/cVOQuID.png-c6edf1a885780ea1abcf4e27549a73e1.s3tc.ctex" +path.etc2="res://.godot/imported/cVOQuID.png-c6edf1a885780ea1abcf4e27549a73e1.etc2.ctex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://cVOQuID.png" +dest_files=["res://.godot/imported/cVOQuID.png-c6edf1a885780ea1abcf4e27549a73e1.s3tc.ctex", "res://.godot/imported/cVOQuID.png-c6edf1a885780ea1abcf4e27549a73e1.etc2.ctex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +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/default_bus_layout.tres b/default_bus_layout.tres index 6b98727..56629ca 100644 --- a/default_bus_layout.tres +++ b/default_bus_layout.tres @@ -1,4 +1,4 @@ -[gd_resource type="AudioBusLayout" load_steps=3 format=3 uid="uid://crf8d0b3y6o3w"] +[gd_resource type="AudioBusLayout" load_steps=3 format=3 uid="uid://s5g8eu8aqxig"] [sub_resource type="AudioEffectPanner" id="AudioEffectPanner_bp6bg"] resource_name = "Panner" diff --git a/p5lFkJY.png b/p5lFkJY.png new file mode 100644 index 0000000..0f18667 Binary files /dev/null and b/p5lFkJY.png differ diff --git a/p5lFkJY.png.import b/p5lFkJY.png.import new file mode 100644 index 0000000..525cf24 --- /dev/null +++ b/p5lFkJY.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://eg0k8esm2scp" +path.s3tc="res://.godot/imported/p5lFkJY.png-befd11338f5b393fdd205b3204b7d5b1.s3tc.ctex" +path.etc2="res://.godot/imported/p5lFkJY.png-befd11338f5b393fdd205b3204b7d5b1.etc2.ctex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://p5lFkJY.png" +dest_files=["res://.godot/imported/p5lFkJY.png-befd11338f5b393fdd205b3204b7d5b1.s3tc.ctex", "res://.godot/imported/p5lFkJY.png-befd11338f5b393fdd205b3204b7d5b1.etc2.ctex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +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/sVaNs3z.png b/sVaNs3z.png new file mode 100644 index 0000000..5d49c15 Binary files /dev/null and b/sVaNs3z.png differ diff --git a/sVaNs3z.png.import b/sVaNs3z.png.import new file mode 100644 index 0000000..a292522 --- /dev/null +++ b/sVaNs3z.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqypsbceya4gb" +path.s3tc="res://.godot/imported/sVaNs3z.png-b93cbe626f7639daaa9d5a0bb4692287.s3tc.ctex" +path.etc2="res://.godot/imported/sVaNs3z.png-b93cbe626f7639daaa9d5a0bb4692287.etc2.ctex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://sVaNs3z.png" +dest_files=["res://.godot/imported/sVaNs3z.png-b93cbe626f7639daaa9d5a0bb4692287.s3tc.ctex", "res://.godot/imported/sVaNs3z.png-b93cbe626f7639daaa9d5a0bb4692287.etc2.ctex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +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/scripts/Logic/Game.gd b/scripts/Logic/Game.gd index 65dc349..ae67381 100644 --- a/scripts/Logic/Game.gd +++ b/scripts/Logic/Game.gd @@ -44,7 +44,14 @@ func _on_hit_player(player1,dmg): func _process(delta): p1_train.current_distance += p1_train.current_speed * delta p2_train.current_distance += p2_train.current_speed * delta + p1_train.distance_from_start += p1_train.current_speed * delta + p2_train.distance_from_start += p1_train.current_speed * delta + if(p1_node == StartNode && p1_train.distance_from_start > 5): + p1_train.distance_from_start = 0 + if(p2_node == StartNode && p2_train.distance_from_start > 5): + p2_train.distance_from_start = 0 + if(p1_train.current_distance >= p1_node.LENGTH): var distance_delta = p1_train.current_distance - p1_node.LENGTH p1_node = p1_node._on_train_exit(p1_train) diff --git a/scripts/Player.gd b/scripts/Player.gd index e542460..dee7700 100644 --- a/scripts/Player.gd +++ b/scripts/Player.gd @@ -13,12 +13,23 @@ var is_alive = true #---------------Methods--------------# func _physics_process(delta): + if(velocity.length() > 0): + $AnimatedSprite3D.play("walking") + else: + $AnimatedSprite3D.play("idle") movement = Vector3(0,0,0) - check_interaction() check_input() velocity = movement * SPEED + if velocity.x < 0: + $AnimatedSprite3D.rotation.y = deg_to_rad(90) + if velocity.x > 0: + $AnimatedSprite3D.rotation.y = deg_to_rad(-90) + if velocity.z > 0: + $AnimatedSprite3D.rotation.y = deg_to_rad(-180) + if velocity.z < 0: + $AnimatedSprite3D.rotation.y = deg_to_rad(0) move_and_slide() func check_input(): diff --git a/scripts/Train.gd b/scripts/Train.gd index 97e5ebd..6c64b3d 100644 --- a/scripts/Train.gd +++ b/scripts/Train.gd @@ -6,6 +6,7 @@ signal game_over var is_P1 = true var current_distance = 0 +var distance_from_start = 0 var current_speed = 5 var CANNONS = [] var STORAGES = []