diff --git a/player/assets/Outch.png b/player/assets/Outch.png new file mode 100644 index 0000000..1764b7c --- /dev/null +++ b/player/assets/Outch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1450126041bf7d5a6797ded5991e4b6fddeb5dac93deffc5f9c68ff8c22facd4 +size 588 diff --git a/player/assets/Outch.png.import b/player/assets/Outch.png.import new file mode 100644 index 0000000..478a3f5 --- /dev/null +++ b/player/assets/Outch.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dwn548x0n4bpd" +path="res://.godot/imported/Outch.png-fb0d67fa327c4c83d19c4122b53475dc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/assets/Outch.png" +dest_files=["res://.godot/imported/Outch.png-fb0d67fa327c4c83d19c4122b53475dc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +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=1 diff --git a/player/player.gd b/player/player.gd index 41ecaa7..c7dd390 100644 --- a/player/player.gd +++ b/player/player.gd @@ -63,9 +63,9 @@ func _physics_process(delta: float) -> void: velocity += get_gravity() * delta * gravity_modifier var direction := Input.get_axis("move_left", "move_right") - if direction > 0: + if direction > 0 and is_on_floor(): look_right() - if direction < 0: + if direction < 0 and is_on_floor(): look_left() diff --git a/player/player.tscn b/player/player.tscn index 13740b8..fc75f53 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -1,29 +1,21 @@ -[gd_scene load_steps=32 format=3 uid="uid://yvp44oauis4n"] +[gd_scene load_steps=30 format=3 uid="uid://yvp44oauis4n"] [ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"] [ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="2_qjkh3"] -[ext_resource type="Texture2D" uid="uid://dg1okdxx73qx2" path="res://player/assets/itch hurt 2 sheet-Sheet.png" id="3_g6k8r"] +[ext_resource type="Texture2D" uid="uid://dwn548x0n4bpd" path="res://player/assets/Outch.png" id="3_rgyib"] [ext_resource type="Texture2D" uid="uid://dr5ypp4q8n2xm" path="res://player/assets/DebutIdle.png" id="4_rgyib"] [ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="5_boad6"] [ext_resource type="PackedScene" uid="uid://djwoetcyvvofc" path="res://damageable/damageable.tscn" id="5_g6k8r"] [ext_resource type="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="5_qjkh3"] [ext_resource type="Texture2D" uid="uid://dw6tn0grt2ajc" path="res://player/assets/WalkCycle.png" id="5_rgyib"] -[sub_resource type="AtlasTexture" id="AtlasTexture_boad6"] -atlas = ExtResource("3_g6k8r") -region = Rect2(80, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_rgyib"] -atlas = ExtResource("3_g6k8r") -region = Rect2(160, 0, 80, 80) - [sub_resource type="AtlasTexture" id="AtlasTexture_hg6s5"] -atlas = ExtResource("3_g6k8r") -region = Rect2(240, 0, 80, 80) +atlas = ExtResource("3_rgyib") +region = Rect2(0, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_8t03j"] -atlas = ExtResource("3_g6k8r") -region = Rect2(320, 0, 80, 80) +atlas = ExtResource("3_rgyib") +region = Rect2(32, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_wodsf"] atlas = ExtResource("4_rgyib") @@ -101,20 +93,14 @@ region = Rect2(352, 0, 32, 32) animations = [{ "frames": [{ "duration": 1.0, -"texture": SubResource("AtlasTexture_boad6") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_rgyib") -}, { -"duration": 1.0, "texture": SubResource("AtlasTexture_hg6s5") }, { "duration": 1.0, "texture": SubResource("AtlasTexture_8t03j") }], -"loop": false, +"loop": true, "name": &"got_hit", -"speed": 10.0 +"speed": 8.0 }, { "frames": [{ "duration": 1.0, @@ -205,9 +191,9 @@ autoplay = "idle" [node name="Base" type="AnimatedSprite2D" parent="."] position = Vector2(0, -16) sprite_frames = SubResource("SpriteFrames_mmwog") -animation = &"jump" +animation = &"got_hit" autoplay = "idle" -frame_progress = 0.808295 +frame_progress = 0.993718 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] visible = false