Basic animations for Blobby
This commit is contained in:
parent
db1696721f
commit
fb52fd0ecd
BIN
assets/blobby/blobby-spritesheett.aseprite
Normal file
BIN
assets/blobby/blobby-spritesheett.aseprite
Normal file
Binary file not shown.
26
assets/blobby/blobby-spritesheett.aseprite.import
Normal file
26
assets/blobby/blobby-spritesheett.aseprite.import
Normal file
@ -0,0 +1,26 @@
|
||||
[remap]
|
||||
|
||||
importer="aseprite.wizard.plugin"
|
||||
type="SpriteFrames"
|
||||
path="res://.import/blobby-spritesheett.aseprite-d18d1784e0bcefbf61e41d349f337576.res"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/blobby/blobby-spritesheett.aseprite"
|
||||
dest_files=[ "res://.import/blobby-spritesheett.aseprite-d18d1784e0bcefbf61e41d349f337576.res" ]
|
||||
|
||||
[params]
|
||||
|
||||
split_layers=false
|
||||
exclude_layers_pattern=""
|
||||
only_visible_layers=false
|
||||
sheet_type="Packed"
|
||||
sprite_filename_pattern="{basename}.{layer}.{extension}"
|
||||
texture_strip/import_texture_strip=false
|
||||
texture_strip/filename_pattern="{basename}.{layer}.Strip.{extension}"
|
||||
texture_atlas/import_texture_atlas=false
|
||||
texture_atlas/filename_pattern="{basename}.{layer}.Atlas.{extension}"
|
||||
texture_atlas/frame_filename_pattern="{basename}.{layer}.{animation}.{frame}.Atlas.{extension}"
|
||||
animated_texture/import_animated_texture=false
|
||||
animated_texture/filename_pattern="{basename}.{layer}.{animation}.Texture.{extension}"
|
||||
animated_texture/frame_filename_pattern="{basename}.{layer}.{animation}.{frame}.Texture.{extension}"
|
||||
Binary file not shown.
BIN
assets/blobby/walk/neu-blobby-proto-walk-anm-test.png
Normal file
BIN
assets/blobby/walk/neu-blobby-proto-walk-anm-test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
35
assets/blobby/walk/neu-blobby-proto-walk-anm-test.png.import
Normal file
35
assets/blobby/walk/neu-blobby-proto-walk-anm-test.png.import
Normal file
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/neu-blobby-proto-walk-anm-test.png-5402131ce2ea57bd684ef66788556811.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/blobby/walk/neu-blobby-proto-walk-anm-test.png"
|
||||
dest_files=[ "res://.import/neu-blobby-proto-walk-anm-test.png-5402131ce2ea57bd684ef66788556811.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=false
|
||||
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
|
||||
@ -7,7 +7,7 @@ onready var right_wall_raycasts = $WallRaycasts/RightWallRaycast
|
||||
onready var player_state_machine = $BlobbyStateMachine
|
||||
onready var init_boost = player_state_machine.init_boost
|
||||
onready var init_boost_type = player_state_machine.init_boost_type
|
||||
|
||||
onready var animation_player = $BlobbySprite/BlobbymationPlayer
|
||||
# TODO Too much speed through midair boosting
|
||||
# TODO Walljump of of enemies/object not only walls
|
||||
|
||||
@ -219,6 +219,7 @@ func calculate_fall_velocity(
|
||||
)
|
||||
else:
|
||||
linear_velocity.y = max_velocity["fall"]
|
||||
# TODO Gets velocity away from wall when moving against it
|
||||
if (-4 < velocity.x and velocity.x < 4) :
|
||||
# TODO This is poop
|
||||
linear_velocity.x += inair_velocity * direction.x
|
||||
|
||||
BIN
src/Actors/Blobby/Blobby.png
Normal file
BIN
src/Actors/Blobby/Blobby.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
35
src/Actors/Blobby/Blobby.png.import
Normal file
35
src/Actors/Blobby/Blobby.png.import
Normal file
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Blobby.png-42eed5028ccb56a7415a0793b79ec61e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/Actors/Blobby/Blobby.png"
|
||||
dest_files=[ "res://.import/Blobby.png-42eed5028ccb56a7415a0793b79ec61e.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=false
|
||||
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
|
||||
@ -1,15 +1,76 @@
|
||||
[gd_scene load_steps=9 format=2]
|
||||
[gd_scene load_steps=12 format=2]
|
||||
|
||||
[ext_resource path="res://src/Actors/Blobby/BlobbyCam.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/Actors/Blobby/BlobbyStateMachine.gd" type="Script" id=3]
|
||||
[ext_resource path="res://src/Actors/Blobby/Blobby.gd" type="Script" id=4]
|
||||
[ext_resource path="res://assets/meta/new_dynamicfont.tres" type="DynamicFont" id=5]
|
||||
|
||||
[sub_resource type="StreamTexture" id=3]
|
||||
load_path = "res://.import/Layer 1.png-0b67f940a501a482178a05e168cce974.stex"
|
||||
[sub_resource type="StreamTexture" id=5]
|
||||
load_path = "res://.import/Blobby.png-42eed5028ccb56a7415a0793b79ec61e.stex"
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
resource_name = "idle"
|
||||
[sub_resource type="Animation" id=6]
|
||||
length = 0.1
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = false
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ 7.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=7]
|
||||
length = 0.1
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = false
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ 5.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=8]
|
||||
length = 0.1
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = false
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ 6.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=9]
|
||||
length = 0.5
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = false
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0.0, 1.0, 2.0, 3.0, 4.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 13, 9 )
|
||||
@ -22,16 +83,20 @@ collision_mask = 120
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="BlobbySprite" type="Sprite" parent="."]
|
||||
position = Vector2( 0, -10 )
|
||||
texture = SubResource( 3 )
|
||||
hframes = 2
|
||||
position = Vector2( 0, -16 )
|
||||
texture = SubResource( 5 )
|
||||
hframes = 3
|
||||
vframes = 3
|
||||
frame = 5
|
||||
__meta__ = {
|
||||
"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUJsb2JieVNwcml0ZS9CbG9iYnltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvYmxvYmJ5L2p1bXAvbmV1LWJsb2JieS1qdW1wZ2Fpbl9hbHRpdHVkZS5hc2Vwcml0ZQpsYXllcnw9TGF5ZXIgMQpvcF9leHB8PUZhbHNlCm9fZm9sZGVyfD0Kb19uYW1lfD0Kb25seV92aXNpYmxlfD1GYWxzZQpvX2V4X3B8PQo="
|
||||
"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUJsb2JieVNwcml0ZS9CbG9iYnltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvYmxvYmJ5L2Jsb2JieS1zcHJpdGVzaGVldHQuYXNlcHJpdGUKbGF5ZXJ8PUJsb2JieQpvcF9leHB8PUZhbHNlCm9fZm9sZGVyfD0Kb19uYW1lfD0Kb25seV92aXNpYmxlfD1GYWxzZQpvX2V4X3B8PQo="
|
||||
}
|
||||
|
||||
[node name="BlobbymationPlayer" type="AnimationPlayer" parent="BlobbySprite"]
|
||||
pause_mode = 1
|
||||
anims/idle = SubResource( 4 )
|
||||
anims/falling = SubResource( 6 )
|
||||
anims/idling = SubResource( 7 )
|
||||
anims/jumping = SubResource( 8 )
|
||||
anims/walking = SubResource( 9 )
|
||||
|
||||
[node name="BlobbyBody" type="CollisionShape2D" parent="." groups=["player"]]
|
||||
position = Vector2( 0, -9 )
|
||||
|
||||
@ -7,6 +7,8 @@ export var coyote_hanging = false
|
||||
export var init_boost = false
|
||||
export var init_boost_type = "idle_walk"
|
||||
onready var jumpBufferTimer = $JumpBufferTimer
|
||||
onready var anim_player = parent.get_node("BlobbySprite/BlobbymationPlayer")
|
||||
onready var sprite = parent.get_node("BlobbySprite")
|
||||
|
||||
|
||||
# Adds the intial states
|
||||
@ -19,6 +21,7 @@ func _ready():
|
||||
add_state("wallslide")
|
||||
state = states.idle
|
||||
set_state(states.idle)
|
||||
anim_player.play("idling")
|
||||
|
||||
|
||||
# Calls the parent behaviours according to state
|
||||
@ -51,8 +54,13 @@ func _state_logic(delta):
|
||||
print("don't panik")
|
||||
|
||||
var direction = get_horizontal_direction()
|
||||
if direction.x < 0:
|
||||
sprite.flip_h = true
|
||||
elif direction.x > 0:
|
||||
sprite.flip_h = false
|
||||
|
||||
parent.velocity = handle_input_ref.call_func(delta, direction)
|
||||
|
||||
parent.execute_movement()
|
||||
|
||||
|
||||
@ -159,6 +167,20 @@ func _enter_state(new_state, old_state):
|
||||
# TODO This may be hard to keep track of if many states are added
|
||||
if !["run", "walk", "idle"].has(old_state) && parent.is_on_floor():
|
||||
emit_signal("got_grounded")
|
||||
|
||||
match new_state:
|
||||
states.walk:
|
||||
anim_player.play("walking")
|
||||
states.idle:
|
||||
anim_player.play("idling")
|
||||
states.jump:
|
||||
anim_player.play("jumping")
|
||||
states.fall:
|
||||
anim_player.get_animation("idling").loop = false
|
||||
anim_player.play("idling")
|
||||
anim_player.queue("falling")
|
||||
states.run:
|
||||
anim_player.play("walking",-1, 1.33)
|
||||
|
||||
|
||||
func _exit_state(old_state, new_state):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user