diff --git a/pwojeto/.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.md5 b/pwojeto/.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.md5 new file mode 100644 index 0000000..745a994 --- /dev/null +++ b/pwojeto/.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.md5 @@ -0,0 +1,3 @@ +source_md5="8ce2efe254e148856fd27a3288733b54" +dest_md5="55cbc11dd1f61f6dbfa0d396c6796ac9" + diff --git a/pwojeto/.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.stex b/pwojeto/.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.stex new file mode 100644 index 0000000..be72d12 Binary files /dev/null and b/pwojeto/.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.stex differ diff --git a/pwojeto/Assets/icone/raposa_espada_final_eyeless.png b/pwojeto/Assets/icone/raposa_espada_final_eyeless.png new file mode 100644 index 0000000..63adbd5 Binary files /dev/null and b/pwojeto/Assets/icone/raposa_espada_final_eyeless.png differ diff --git a/pwojeto/Assets/icone/raposa_espada_final_eyeless.png.import b/pwojeto/Assets/icone/raposa_espada_final_eyeless.png.import new file mode 100644 index 0000000..784aeac --- /dev/null +++ b/pwojeto/Assets/icone/raposa_espada_final_eyeless.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/icone/raposa_espada_final_eyeless.png" +dest_files=[ "res://.import/raposa_espada_final_eyeless.png-453dd7b4a86ecb613de4b03953125c19.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/pwojeto/Assets/icone/raposa_espada_final_eyeless_Zpi_icon.ico b/pwojeto/Assets/icone/raposa_espada_final_eyeless_Zpi_icon.ico new file mode 100644 index 0000000..d74264e Binary files /dev/null and b/pwojeto/Assets/icone/raposa_espada_final_eyeless_Zpi_icon.ico differ diff --git a/pwojeto/Scenes/actors/enemies/Bat.tscn b/pwojeto/Scenes/actors/enemies/Bat.tscn index 98a422a..5d5e87d 100644 --- a/pwojeto/Scenes/actors/enemies/Bat.tscn +++ b/pwojeto/Scenes/actors/enemies/Bat.tscn @@ -1,37 +1,58 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://Scripts/Morcego.gd" type="Script" id=1] -[ext_resource path="res://icon.png" type="Texture" id=2] +[ext_resource path="res://Assets/Morcego/batspritesheet.png" type="Texture" id=2] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 61.4362, 60.6278 ) - -[sub_resource type="SpriteFrames" id=2] -animations = [ { -"frames": [ ExtResource( 2 ) ], -"loop": true, -"name": "default", -"speed": 5.0 -}, { -"frames": [ ], -"loop": true, -"name": "New Anim", -"speed": 5.0 -} ] +extents = Vector2( 67.8006, 66.8752 ) [sub_resource type="CircleShape2D" id=3] radius = 655.591 +[sub_resource type="Animation" id=4] +resource_name = "parado" +step = 1.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0 ] +} + +[sub_resource type="Animation" id=5] +resource_name = "voando" +loop = true +step = 0.125 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 0, 1, 2, 3, 4, 5, 6, 7, 0 ] +} + [node name="Bat" type="KinematicBody2D"] script = ExtResource( 1 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 1 ) -[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +[node name="Sprite" type="Sprite" parent="."] scale = Vector2( 2, 2 ) -frames = SubResource( 2 ) -playing = true +texture = ExtResource( 2 ) +vframes = 2 +hframes = 4 [node name="Range" type="Area2D" parent="."] @@ -43,5 +64,10 @@ shape = SubResource( 3 ) [node name="KnockbackTimer" type="Timer" parent="."] wait_time = 0.1 one_shot = true + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "parado" +anims/parado = SubResource( 4 ) +anims/voando = SubResource( 5 ) [connection signal="body_entered" from="Range" to="." method="_on_Area2D_body_entered"] [connection signal="body_exited" from="Range" to="." method="_on_Range_body_exited"] diff --git a/pwojeto/Scenes/actors/enemies/Spider.tscn b/pwojeto/Scenes/actors/enemies/Spider.tscn index ffd3c5a..d304369 100644 --- a/pwojeto/Scenes/actors/enemies/Spider.tscn +++ b/pwojeto/Scenes/actors/enemies/Spider.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://Assets/Aranha/Aranha andando.png" type="Texture" id=1] [ext_resource path="res://Spider.gd" type="Script" id=2] +[ext_resource path="res://Assets/Aranha/Aranha pulo.png" type="Texture" id=3] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 62.5195, 61.5018 ) @@ -9,7 +10,7 @@ extents = Vector2( 62.5195, 61.5018 ) [sub_resource type="CircleShape2D" id=2] radius = 901.289 -[sub_resource type="Animation" id=4] +[sub_resource type="Animation" id=3] resource_name = "andando" loop = true step = 0.0416667 @@ -37,9 +38,162 @@ tracks/1/keys = { "update": 1, "values": [ true, true ] } +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Sprite2:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} -[sub_resource type="Animation" id=3] -resource_name = "parado" +[sub_resource type="Animation" id=7] +resource_name = "escalandoDir" +loop = true +step = 0.0416667 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.0416667, 0.0833333, 0.125, 0.166667, 0.208333, 0.25, 0.291667, 0.333333, 0.375, 0.416667, 0.458333, 0.5, 0.541667, 0.583333, 0.625, 0.666667, 0.708333, 0.75, 0.791667, 0.833333, 0.875, 0.916667, 0.958333, 1 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0 ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Sprite:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ true, true ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Sprite2:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/4/type = "value" +tracks/4/path = NodePath("Sprite:rotation_degrees") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ -90.0 ] +} + +[sub_resource type="Animation" id=6] +resource_name = "escalandoEsq" +loop = true +step = 0.0416667 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.0416667, 0.0833333, 0.125, 0.166667, 0.208333, 0.25, 0.291667, 0.333333, 0.375, 0.416667, 0.458333, 0.5, 0.541667, 0.583333, 0.625, 0.666667, 0.708333, 0.75, 0.791667, 0.833333, 0.875, 0.916667, 0.958333, 1 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0 ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Sprite:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ true, true ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Sprite2:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/4/type = "value" +tracks/4/path = NodePath("Sprite:rotation_degrees") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 90.0 ] +} + +[sub_resource type="Animation" id=4] step = 1.0 tracks/0/type = "value" tracks/0/path = NodePath("Sprite:frame") @@ -53,6 +207,174 @@ tracks/0/keys = { "update": 1, "values": [ 0 ] } +tracks/1/type = "value" +tracks/1/path = NodePath("Sprite:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite2:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} + +[sub_resource type="Animation" id=8] +resource_name = "paradoParedeDir" +step = 1.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0 ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Sprite:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite2:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Sprite:rotation_degrees") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ -90.0 ] +} + +[sub_resource type="Animation" id=9] +resource_name = "paradoParedeEsq" +step = 1.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0 ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Sprite:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite2:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Sprite:rotation_degrees") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 90.0 ] +} + +[sub_resource type="Animation" id=5] +resource_name = "pulando" +step = 0.0416667 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite2:visible") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ true, false ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Sprite:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ false, true ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite2:frame") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0, 0.0416667, 0.0833333, 0.125, 0.166667, 0.208333, 0.25, 0.291667, 0.333333, 0.375, 0.416667, 0.458333, 0.5, 0.541667, 0.583333, 0.625, 0.666667, 0.708333, 0.75, 0.791667, 0.833333, 0.875, 0.916667, 0.958333, 1 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 0, 1, 2, 3, 4, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0 ] +} [node name="Spider" type="KinematicBody2D"] script = ExtResource( 2 ) @@ -62,11 +384,11 @@ shape = SubResource( 1 ) [node name="Sprite" type="Sprite" parent="."] position = Vector2( 4.24241, -3.72709 ) +rotation = -1.5708 scale = Vector2( 0.104778, 0.224614 ) texture = ExtResource( 1 ) vframes = 5 hframes = 5 -frame = 10 [node name="Area2D" type="Area2D" parent="."] @@ -94,8 +416,21 @@ one_shot = true [node name="AnimationPlayer" type="AnimationPlayer" parent="."] autoplay = "parado" -anims/andando = SubResource( 4 ) -anims/parado = SubResource( 3 ) +anims/andando = SubResource( 3 ) +anims/escalandoDir = SubResource( 7 ) +anims/escalandoEsq = SubResource( 6 ) +anims/parado = SubResource( 4 ) +anims/paradoParedeDir = SubResource( 8 ) +anims/paradoParedeEsq = SubResource( 9 ) +anims/pulando = SubResource( 5 ) + +[node name="Sprite2" type="Sprite" parent="."] +visible = false +position = Vector2( 3.21046, 19.1956 ) +scale = Vector2( 0.105657, 0.235971 ) +texture = ExtResource( 3 ) +vframes = 5 +hframes = 5 [connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"] [connection signal="body_exited" from="Area2D" to="." method="_on_Area2D_body_exited"] [connection signal="timeout" from="KnockbackTimer" to="." method="_on_KnockbackTimer_timeout"] diff --git a/pwojeto/Scenes/actors/player/Character.tscn b/pwojeto/Scenes/actors/player/Character.tscn index 52cc24e..7f2b1b5 100644 --- a/pwojeto/Scenes/actors/player/Character.tscn +++ b/pwojeto/Scenes/actors/player/Character.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://Scripts/Character.gd" type="Script" id=1] [ext_resource path="res://Scenes/menus/pause_menu.tscn" type="PackedScene" id=2] @@ -8,7 +8,7 @@ [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 43, 50.3809 ) -[sub_resource type="Animation" id=3] +[sub_resource type="Animation" id=2] resource_name = "golpeEspadaDireita" length = 0.4 tracks/0/type = "value" @@ -48,7 +48,7 @@ tracks/2/keys = { "values": [ 45.0, 55.0, 75.0, 85.0, 95.0 ] } -[sub_resource type="Animation" id=4] +[sub_resource type="Animation" id=3] resource_name = "golpeEspadaEsquerda" length = 0.4 tracks/0/type = "value" @@ -88,7 +88,59 @@ tracks/2/keys = { "values": [ 315.0, 305.0, 295.0, 285.0, 275.0 ] } -[sub_resource type="RectangleShape2D" id=2] +[sub_resource type="Animation" id=6] +resource_name = "parado" +step = 1.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Espada:visible") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Espada2:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Espada/CollisionShape2D:disabled") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Espada2/CollisionShape2D:disabled") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} + +[sub_resource type="RectangleShape2D" id=4] extents = Vector2( 6.44367, 37.4059 ) [sub_resource type="RectangleShape2D" id=5] @@ -124,16 +176,19 @@ one_shot = true visible = false [node name="AnimationPlayer" type="AnimationPlayer" parent="."] -anims/golpeEspadaDireita = SubResource( 3 ) -anims/golpeEspadaEsquerda = SubResource( 4 ) +autoplay = "parado" +anims/golpeEspadaDireita = SubResource( 2 ) +anims/golpeEspadaEsquerda = SubResource( 3 ) +anims/parado = SubResource( 6 ) -[node name="Espada" type="Area2D" parent="."] +[node name="Espada" type="Area2D" parent="." groups=[ +"weapon", +]] position = Vector2( 61.0175, 5.1272 ) rotation = 0.785398 -scale = Vector2( 1, 1 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="Espada"] -shape = SubResource( 2 ) +shape = SubResource( 4 ) __meta__ = { "_edit_lock_": true } @@ -144,15 +199,14 @@ __meta__ = { "_edit_lock_": true } -[node name="Espada2" type="Area2D" parent="."] -visible = false +[node name="Espada2" type="Area2D" parent="." groups=[ +"weapon", +]] position = Vector2( -61.8802, -1.22958 ) -rotation = 4.79966 -scale = Vector2( 1, 1 ) +rotation = 5.49779 [node name="CollisionShape2D" type="CollisionShape2D" parent="Espada2"] shape = SubResource( 5 ) -disabled = true __meta__ = { "_edit_lock_": true } diff --git a/pwojeto/Scenes/test.tscn b/pwojeto/Scenes/test.tscn index d0f3bed..9380a4a 100644 --- a/pwojeto/Scenes/test.tscn +++ b/pwojeto/Scenes/test.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://Scenes/actors/player/Character.tscn" type="PackedScene" id=1] [ext_resource path="res://Scenes/actors/enemies/Bat.tscn" type="PackedScene" id=2] [ext_resource path="res://Scenes/Tilemap/tileset1.tres" type="TileSet" id=3] +[ext_resource path="res://Scenes/actors/enemies/Spider.tscn" type="PackedScene" id=4] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 999.985, 178.658 ) @@ -42,3 +43,6 @@ tile_set = ExtResource( 3 ) cell_size = Vector2( 32, 32 ) format = 1 tile_data = PoolIntArray( 720912, 0, 0, 720913, 1, 0, 720914, 1, 0, 720915, 1, 0, 720916, 1, 0, 720917, 1, 0, 720918, 1, 0, 720919, 2, 0, 786448, 3, 0, 786449, 4, 0, 786450, 4, 0, 786451, 4, 0, 786452, 4, 0, 786453, 4, 0, 786454, 4, 0, 786455, 5, 0, 851984, 3, 0, 851985, 4, 0, 851986, 4, 0, 851987, 4, 0, 851988, 4, 0, 851989, 4, 0, 851990, 4, 0, 851991, 5, 0, 917520, 3, 0, 917521, 4, 0, 917522, 4, 0, 917523, 4, 0, 917524, 4, 0, 917525, 4, 0, 917526, 4, 0, 917527, 5, 0 ) + +[node name="Spider" parent="." instance=ExtResource( 4 )] +position = Vector2( 1243.69, 420.504 ) diff --git a/pwojeto/Scripts/Character.gd b/pwojeto/Scripts/Character.gd index a1a31bb..d231a33 100644 --- a/pwojeto/Scripts/Character.gd +++ b/pwojeto/Scripts/Character.gd @@ -10,14 +10,13 @@ var life=100 var double_jump_cost=10 var wall_jump_cost=5 var has_wall_jump=true +var melee_atack_cost = 1 onready var espadaDir = $Espada onready var espadaEsq = $Espada2 var direita = true func _ready(): - if direita: - espadaDir.connect("body_entered",self,"atack") - else: - espadaEsq.connect("body_entered",self,"atack") + espadaDir.connect("body_entered",self,"atack") + espadaEsq.connect("body_entered",self,"atack") set_physics_process(true) pass # Replace with function body. @@ -84,8 +83,8 @@ func damage(damage): queue_free() func atack(body): - if body.is_in_group("enemy"): - print("cheguei") + if (body.is_in_group("enemy")): body.hit() + damage(melee_atack_cost) pass pass diff --git a/pwojeto/Scripts/Morcego.gd b/pwojeto/Scripts/Morcego.gd index 28dd972..f698cda 100644 --- a/pwojeto/Scripts/Morcego.gd +++ b/pwojeto/Scripts/Morcego.gd @@ -8,6 +8,9 @@ var knockback_speed=1000 func _ready(): add_to_group("enemy") set_physics_process(true) + #print("estou aqui") + + func _physics_process(delta): if alvo!=null and $KnockbackTimer.is_stopped(): velocity=alvo.global_position-global_position @@ -15,13 +18,17 @@ func _physics_process(delta): elif $KnockbackTimer.is_stopped(): velocity=Vector2(0,0) var collision=move_and_collide(velocity*delta) - if collision and collision.collider.is_in_group("character"): + if collision and (collision.collider.is_in_group("character") or collision.collider.is_in_group("weapon")): collision.collider.damage(DAMAGE) knockback() - if velocity.x<0 and $AnimatedSprite.flip_h==true: - $AnimatedSprite.flip_h=false - elif velocity.x>0 and $AnimatedSprite.flip_h==false: - $AnimatedSprite.flip_h=true + if velocity.x<0 and $Sprite.flip_h==true: + $Sprite.flip_h=false + $AnimationPlayer.play("voando") + elif velocity.x>0 and $Sprite.flip_h==false: + $Sprite.flip_h=true + $AnimationPlayer.play("voando") + elif velocity.x == 0: + $AnimationPlayer.play("parado") func _on_Area2D_body_entered(body): if body.is_in_group("character"): diff --git a/pwojeto/Spider.gd b/pwojeto/Spider.gd index c46da90..51ad115 100644 --- a/pwojeto/Spider.gd +++ b/pwojeto/Spider.gd @@ -10,30 +10,37 @@ var JUMP_SPEED=1000 var KNOCKBACK_ANGLE=PI/4 var KNOCKBACK_SPEED=1000 var DAMAGE=30 +var esq = false func _ready(): - add_to_group("enemie") + add_to_group("enemy") pass func _physics_process(delta): if alvo!=null: if not is_jumping: - if(global_positionalvo.global_position: - $Sprite.flip_h = true + $Sprite.flip_h = false $AnimationPlayer.play("andando") velocity.x=-SPEED + esq = true else: velocity.x=0 $AnimationPlayer.play("parado") + if is_on_floor(): + $Sprite.rotation_degrees = 0 if is_on_wall(): - velocity.y=-CLIMBSPEED + if esq: + $Sprite.rotation_degrees = 90 + else: + $Sprite.rotation_degrees = -90 elif not is_on_floor(): velocity.y+=GRAVITY if is_on_floor() and ((velocity.x<0 and not $RayCastLeft.is_colliding() )or(velocity.x>0 and not $RayCastRight.is_colliding())): @@ -42,10 +49,11 @@ func _physics_process(delta): is_jumping=false else: velocity.y+=GRAVITY + velocity=move_and_slide(velocity,Vector2(0,-1)) for i in get_slide_count(): var collision=get_slide_collision(i) - if collision and collision.collider.is_in_group("character"): + if collision and (collision.collider.is_in_group("character") or collision.collider.is_in_group("weapon")) : collision.collider.damage(DAMAGE) knockback() @@ -65,6 +73,7 @@ func _on_Area2D_body_exited(body): func jump(): $JumpTimer.start() + $AnimationPlayer.play("pulando") is_jumping=true if velocity.x>0: velocity=Vector2(0,-1).rotated(JUMP_ANGLE)*JUMP_SPEED diff --git a/pwojeto/project.godot b/pwojeto/project.godot index 0085af0..93736ab 100644 --- a/pwojeto/project.godot +++ b/pwojeto/project.godot @@ -17,7 +17,8 @@ _global_script_class_icons={ config/name="PWOjeto" run/main_scene="res://Scenes/menus/main_menu.tscn" -config/icon="res://icon.png" +config/icon="res://Assets/icone/raposa_espada_final_eyeless.png" +config/windows_native_icon="res://Assets/icone/raposa_espada_final_eyeless_Zpi_icon.ico" [autoload] @@ -28,7 +29,7 @@ Global="*res://Global/global.gd" window/size/width=1920 window/size/height=1080 window/size/fullscreen=true -window/stretch/mode="viewport" +window/stretch/mode="2d" window/stretch/aspect="keep" [input]