diff --git a/Assets/Player.png b/Assets/Player.png index 15e09db..4ea4169 100755 Binary files a/Assets/Player.png and b/Assets/Player.png differ diff --git a/Characters/player.gd b/Characters/player.gd index 269a71b..2fe7976 100755 --- a/Characters/player.gd +++ b/Characters/player.gd @@ -91,8 +91,21 @@ const BRIDGE_LEAN_LEFT_FRAME = 12 # Most of us bunched at the bottom. const BRIDGE_VERTICAL_FRAME = 13 # Floor to ceiling. # Floor to ceiling, leaning towards the surface we're holding towards: most of # us down on the floor, or up on the ceiling. -const BRIDGE_VERTICAL_DOWN_FRAME = 14 -const BRIDGE_VERTICAL_UP_FRAME = 15 +const BRIDGE_VERTICAL_DOWN_FRAME = 15 +const BRIDGE_VERTICAL_UP_FRAME = 17 +# Halfway into each lean. The lean animations open on these, then go on to the +# full lean. +const BRIDGE_LEAN_RIGHT_MID_FRAME = 18 +const BRIDGE_LEAN_LEFT_MID_FRAME = 19 +const BRIDGE_VERTICAL_DOWN_MID_FRAME = 14 +const BRIDGE_VERTICAL_UP_MID_FRAME = 16 +# Every column frame, all centred between the surfaces (see _align_press_wall_sprite). +const BRIDGE_FRAMES = [ + BRIDGE_FRAME, BRIDGE_LEAN_RIGHT_FRAME, BRIDGE_LEAN_LEFT_FRAME, + BRIDGE_LEAN_RIGHT_MID_FRAME, BRIDGE_LEAN_LEFT_MID_FRAME, + BRIDGE_VERTICAL_FRAME, BRIDGE_VERTICAL_DOWN_FRAME, BRIDGE_VERTICAL_UP_FRAME, + BRIDGE_VERTICAL_DOWN_MID_FRAME, BRIDGE_VERTICAL_UP_MID_FRAME, +] const BRIDGE_GAP = 32.0 # One tile. const BRIDGE_GAP_TOLERANCE = 1.5 # How long we show the plain bridge frame after attaching before leaning towards @@ -224,7 +237,7 @@ func _ready() -> void: # they reform as from the sprite's offset, and that must not carry the shift. func _align_press_wall_sprite() -> void: var targetPosition := spriteBasePosition - if sprite.frame in [BRIDGE_FRAME, BRIDGE_LEAN_RIGHT_FRAME, BRIDGE_LEAN_LEFT_FRAME, BRIDGE_VERTICAL_FRAME, BRIDGE_VERTICAL_DOWN_FRAME, BRIDGE_VERTICAL_UP_FRAME]: + if sprite.frame in BRIDGE_FRAMES: # The sprite's offset lifts it off the surface we're on. Undo that so the # column sits centred on us, between the surfaces. targetPosition -= sprite.offset.rotated(sprite.rotation).round() @@ -673,18 +686,18 @@ func _show_bridge_pose() -> void: # and its top on the right. _set_sprite_rotation(_rotation_for(Vector2.RIGHT)) if bridgeLean < 0: - _show_pose(&"BridgeLeanLeft", BRIDGE_LEAN_LEFT_FRAME) + _show_pose(&"BridgeLeanLeft", BRIDGE_LEAN_LEFT_MID_FRAME) elif bridgeLean > 0: - _show_pose(&"BridgeLeanRight", BRIDGE_LEAN_RIGHT_FRAME) + _show_pose(&"BridgeLeanRight", BRIDGE_LEAN_RIGHT_MID_FRAME) else: _show_pose(&"Bridge", BRIDGE_FRAME) else: # Upright. _set_sprite_rotation(0.0) if bridgeLean < 0: - _show_pose(&"BridgeVerticalUp", BRIDGE_VERTICAL_UP_FRAME) + _show_pose(&"BridgeVerticalUp", BRIDGE_VERTICAL_UP_MID_FRAME) elif bridgeLean > 0: - _show_pose(&"BridgeVerticalDown", BRIDGE_VERTICAL_DOWN_FRAME) + _show_pose(&"BridgeVerticalDown", BRIDGE_VERTICAL_DOWN_MID_FRAME) else: _show_pose(&"BridgeVertical", BRIDGE_VERTICAL_FRAME) diff --git a/Characters/player.tscn b/Characters/player.tscn index ec5f1c7..136d5f9 100755 --- a/Characters/player.tscn +++ b/Characters/player.tscn @@ -32,7 +32,6 @@ tracks/0/keys = { [sub_resource type="Animation" id="Animation_BridgeLeanRight"] resource_name = "BridgeLeanRight" length = 0.2 -loop_mode = 1 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -40,16 +39,15 @@ tracks/0/path = NodePath("Sprite2D:frame") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), +"times": PackedFloat32Array(0, 0.1), +"transitions": PackedFloat32Array(1, 1), "update": 1, -"values": [11] +"values": [18, 11] } [sub_resource type="Animation" id="Animation_BridgeLeanLeft"] resource_name = "BridgeLeanLeft" length = 0.2 -loop_mode = 1 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -57,10 +55,10 @@ tracks/0/path = NodePath("Sprite2D:frame") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), +"times": PackedFloat32Array(0, 0.1), +"transitions": PackedFloat32Array(1, 1), "update": 1, -"values": [12] +"values": [19, 12] } [sub_resource type="Animation" id="Animation_BridgeVertical"] @@ -83,7 +81,6 @@ tracks/0/keys = { [sub_resource type="Animation" id="Animation_BridgeVerticalDown"] resource_name = "BridgeVerticalDown" length = 0.2 -loop_mode = 1 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -91,16 +88,15 @@ tracks/0/path = NodePath("Sprite2D:frame") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), +"times": PackedFloat32Array(0, 0.1), +"transitions": PackedFloat32Array(1, 1), "update": 1, -"values": [14] +"values": [14, 15] } [sub_resource type="Animation" id="Animation_BridgeVerticalUp"] resource_name = "BridgeVerticalUp" length = 0.2 -loop_mode = 1 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -108,10 +104,10 @@ tracks/0/path = NodePath("Sprite2D:frame") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), +"times": PackedFloat32Array(0, 0.1), +"transitions": PackedFloat32Array(1, 1), "update": 1, -"values": [15] +"values": [16, 17] } [sub_resource type="Animation" id="Animation_Crouch"] @@ -584,7 +580,7 @@ landSounds = Array[AudioStream]([ExtResource("3_land1"), ExtResource("4_land2"), [node name="Sprite2D" type="Sprite2D" parent="." unique_id=402647784] texture = ExtResource("5_4m0gv") offset = Vector2(0, -6) -hframes = 4 +hframes = 5 vframes = 4 [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1379572123] diff --git a/Levels/room_camera.gd b/Levels/room_camera.gd index c7712d3..273173a 100644 --- a/Levels/room_camera.gd +++ b/Levels/room_camera.gd @@ -2,7 +2,7 @@ extends Camera2D class_name RoomCamera # Splits the level into screen-sized rooms and snaps to whichever room the -# target is in, VVVVVV style: the camera never scrolls, it just cuts to the +# target is in: the camera never scrolls, it just cuts to the # next screen when the target crosses a room border. # # Room (0, 0) has its top-left corner at the level's origin, room (1, 0) is the