diff --git a/src/models/enemies/bat/Bat.tscn b/src/models/enemies/bat/Bat.tscn index ed748fd..a6a385d 100644 --- a/src/models/enemies/bat/Bat.tscn +++ b/src/models/enemies/bat/Bat.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://src/models/enemies/bat/sprite.png" type="Texture" id=1] +[ext_resource path="res://src/models/enemies/bat/sprites/bat_spriteframes.tres" type="SpriteFrames" id=1] [ext_resource path="res://src/models/enemies/bat/bat.gd" type="Script" id=2] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 4, 3 ) +extents = Vector2( 3.5, 3 ) [sub_resource type="RectangleShape2D" id=2] extents = Vector2( 6, 4 ) @@ -15,17 +15,20 @@ collision_layer = 2 collision_mask = 2 script = ExtResource( 2 ) -[node name="Sprite" type="Sprite" parent="."] +[node name="Sprite" type="AnimatedSprite" parent="."] use_parent_material = true -texture = ExtResource( 1 ) +frames = ExtResource( 1 ) +animation = "idle" +frame = 3 +playing = true centered = false [node name="Area2D" type="Area2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] -position = Vector2( 7, 4 ) +position = Vector2( 8.5, 10 ) shape = SubResource( 1 ) [node name="SameSpeciesCollider" type="CollisionShape2D" parent="."] -position = Vector2( 7, 4 ) +position = Vector2( 8.5, 10 ) shape = SubResource( 2 ) diff --git a/src/models/enemies/bat/bat.gd b/src/models/enemies/bat/bat.gd index 9c7fbb3..96dc75e 100644 --- a/src/models/enemies/bat/bat.gd +++ b/src/models/enemies/bat/bat.gd @@ -25,5 +25,7 @@ func _physics_process(_delta): velocity.x = cos(angle + 180) velocity.y = sin(angle + 180) + self.global_position.y += sin(Time.get_ticks_msec() * 0.01) / 3 + velocity *= speed * speed_multiplier velocity = move_and_slide(velocity) diff --git a/src/models/enemies/bat/sprite.png b/src/models/enemies/bat/sprite.png deleted file mode 100644 index b30bf61..0000000 Binary files a/src/models/enemies/bat/sprite.png and /dev/null differ diff --git a/src/models/enemies/bat/sprites/bat.png b/src/models/enemies/bat/sprites/bat.png new file mode 100644 index 0000000..cb6f95f Binary files /dev/null and b/src/models/enemies/bat/sprites/bat.png differ diff --git a/src/models/enemies/bat/sprite.png.import b/src/models/enemies/bat/sprites/bat.png.import similarity index 71% rename from src/models/enemies/bat/sprite.png.import rename to src/models/enemies/bat/sprites/bat.png.import index 2b84f0a..c348d5c 100644 --- a/src/models/enemies/bat/sprite.png.import +++ b/src/models/enemies/bat/sprites/bat.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/sprite.png-742176af9ae55b1874092f535d7f098a.stex" +path="res://.import/bat.png-fb52342f0135bec2219869dda59a68bd.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/models/enemies/bat/sprite.png" -dest_files=[ "res://.import/sprite.png-742176af9ae55b1874092f535d7f098a.stex" ] +source_file="res://src/models/enemies/bat/sprites/bat.png" +dest_files=[ "res://.import/bat.png-fb52342f0135bec2219869dda59a68bd.stex" ] [params] diff --git a/src/models/enemies/bat/sprites/bat_spriteframes.tres b/src/models/enemies/bat/sprites/bat_spriteframes.tres new file mode 100644 index 0000000..2332270 --- /dev/null +++ b/src/models/enemies/bat/sprites/bat_spriteframes.tres @@ -0,0 +1,27 @@ +[gd_resource type="SpriteFrames" load_steps=6 format=2] + +[ext_resource path="res://src/models/enemies/bat/sprites/bat.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 20, 20 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 20, 0, 20, 20 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 40, 0, 20, 20 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 1 ) +region = Rect2( 60, 0, 20, 20 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ) ], +"loop": true, +"name": "idle", +"speed": 12.0 +} ] diff --git a/src/models/enemies/ghost/Ghost.tscn b/src/models/enemies/ghost/Ghost.tscn index 4773bf0..6d47d9f 100644 --- a/src/models/enemies/ghost/Ghost.tscn +++ b/src/models/enemies/ghost/Ghost.tscn @@ -1,22 +1,24 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://src/models/enemies/ghost/sprites/ghost.png" type="Texture" id=1] +[ext_resource path="res://src/models/enemies/ghost/sprites/ghost_spriteframes.tres" type="SpriteFrames" id=1] [ext_resource path="res://src/models/enemies/ghost/ghost.gd" type="Script" id=2] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 7, 9 ) +extents = Vector2( 5.5, 5.5 ) [node name="Ghost" type="KinematicBody2D" groups=["enemy"]] z_index = 2 script = ExtResource( 2 ) -[node name="Sprite" type="Sprite" parent="."] +[node name="Sprite" type="AnimatedSprite" parent="."] use_parent_material = true -texture = ExtResource( 1 ) +frames = ExtResource( 1 ) +animation = "idle" +playing = true centered = false [node name="Area2D" type="Area2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] -position = Vector2( 7, 9 ) +position = Vector2( 8.5, 13.5 ) shape = SubResource( 1 ) diff --git a/src/models/enemies/ghost/sprites/ghost.png b/src/models/enemies/ghost/sprites/ghost.png index 5a33c4f..f59a329 100644 Binary files a/src/models/enemies/ghost/sprites/ghost.png and b/src/models/enemies/ghost/sprites/ghost.png differ diff --git a/src/models/enemies/ghost/sprites/ghost_spriteframes.tres b/src/models/enemies/ghost/sprites/ghost_spriteframes.tres new file mode 100644 index 0000000..7b8d3ab --- /dev/null +++ b/src/models/enemies/ghost/sprites/ghost_spriteframes.tres @@ -0,0 +1,31 @@ +[gd_resource type="SpriteFrames" load_steps=7 format=2] + +[ext_resource path="res://src/models/enemies/ghost/sprites/ghost.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 18, 22 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 18, 0, 18, 22 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 36, 0, 18, 22 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 1 ) +region = Rect2( 54, 0, 18, 22 ) + +[sub_resource type="AtlasTexture" id=5] +atlas = ExtResource( 1 ) +region = Rect2( 72, 0, 18, 22 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ], +"loop": true, +"name": "idle", +"speed": 12.0 +} ] diff --git a/src/models/enemies/trash_can/TrashCan.tscn b/src/models/enemies/trash_can/TrashCan.tscn index c13bf15..fdec38a 100644 --- a/src/models/enemies/trash_can/TrashCan.tscn +++ b/src/models/enemies/trash_can/TrashCan.tscn @@ -1,21 +1,23 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://src/models/enemies/trash_can/sprites/trash_can.png" type="Texture" id=1] +[ext_resource path="res://src/models/enemies/trash_can/sprites/trash_can_spriteframes.tres" type="SpriteFrames" id=1] [ext_resource path="res://src/models/enemies/trash_can/trash_can.gd" type="Script" id=2] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 6, 7 ) +extents = Vector2( 5.5, 7 ) [node name="TrashCan" type="KinematicBody2D"] z_index = 2 script = ExtResource( 2 ) -[node name="Sprite" type="Sprite" parent="."] +[node name="Sprite" type="AnimatedSprite" parent="."] position = Vector2( 3, 0 ) -texture = ExtResource( 1 ) +frames = ExtResource( 1 ) +animation = "rolling" +playing = true [node name="EnemyCollider" type="Area2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyCollider"] -position = Vector2( 3, 0 ) +position = Vector2( 3.5, 5 ) shape = SubResource( 1 ) diff --git a/src/models/enemies/trash_can/sprites/rolling.png b/src/models/enemies/trash_can/sprites/rolling.png new file mode 100644 index 0000000..62f5868 Binary files /dev/null and b/src/models/enemies/trash_can/sprites/rolling.png differ diff --git a/src/models/enemies/trash_can/sprites/rolling.png.import b/src/models/enemies/trash_can/sprites/rolling.png.import new file mode 100644 index 0000000..a3dbd4a --- /dev/null +++ b/src/models/enemies/trash_can/sprites/rolling.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/rolling.png-40d73114e6eb4a8c6a697e781597c9da.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/models/enemies/trash_can/sprites/rolling.png" +dest_files=[ "res://.import/rolling.png-40d73114e6eb4a8c6a697e781597c9da.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=false +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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/models/enemies/trash_can/sprites/trash_can_spriteframes.tres b/src/models/enemies/trash_can/sprites/trash_can_spriteframes.tres new file mode 100644 index 0000000..37ff401 --- /dev/null +++ b/src/models/enemies/trash_can/sprites/trash_can_spriteframes.tres @@ -0,0 +1,27 @@ +[gd_resource type="SpriteFrames" load_steps=6 format=2] + +[ext_resource path="res://src/models/enemies/trash_can/sprites/rolling.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 22, 24 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 22, 0, 22, 24 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 44, 0, 22, 24 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 1 ) +region = Rect2( 66, 0, 22, 24 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ) ], +"loop": true, +"name": "rolling", +"speed": 16.0 +} ]