Compare commits
No commits in common. "main" and "maze" have entirely different histories.
4 changed files with 15 additions and 229 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 2.6 KiB |
|
|
@ -24,11 +24,8 @@ const CEILING_STICK_SPEED = 20.0
|
||||||
const WALL_STICK_SPEED = 20.0
|
const WALL_STICK_SPEED = 20.0
|
||||||
const SURFACE_SNAP_DISTANCE = 4.0 # Drift off a wall/ceiling by up to this and we pull back on.
|
const SURFACE_SNAP_DISTANCE = 4.0 # Drift off a wall/ceiling by up to this and we pull back on.
|
||||||
|
|
||||||
# How long to hold before letting go or hopping.
|
# How long to hold before letting go, going over an edge, or hopping.
|
||||||
const HOLD_TIME = 0.33
|
const HOLD_TIME = 0.5
|
||||||
# How long to hold towards an edge we've stopped at before going over it.
|
|
||||||
# 0 never stops us at edges at all.
|
|
||||||
const EDGE_HOLD_TIME = 0.1
|
|
||||||
|
|
||||||
# How close an edge must be (from our center) for an edge wrap.
|
# How close an edge must be (from our center) for an edge wrap.
|
||||||
const EDGE_SENSOR_RANGE := 12.0
|
const EDGE_SENSOR_RANGE := 12.0
|
||||||
|
|
@ -84,33 +81,9 @@ const PRESS_WALL_SPRITE_SHIFT = 6.0
|
||||||
# exactly that long, always drawn the same way round and centred between the
|
# exactly that long, always drawn the same way round and centred between the
|
||||||
# surfaces (see _align_press_wall_sprite).
|
# surfaces (see _align_press_wall_sprite).
|
||||||
const BRIDGE_FRAME = 10 # Wall to wall. Drawn upright, so it's turned a quarter.
|
const BRIDGE_FRAME = 10 # Wall to wall. Drawn upright, so it's turned a quarter.
|
||||||
# Wall to wall, leaning towards the wall we're holding towards. Drawn upright
|
const BRIDGE_VERTICAL_FRAME = 11 # Floor to ceiling.
|
||||||
# and turned like BRIDGE_FRAME, so the frame's top ends up on the right.
|
|
||||||
const BRIDGE_LEAN_RIGHT_FRAME = 11 # Most of us bunched at the top.
|
|
||||||
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 = 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 = 32.0 # One tile.
|
||||||
const BRIDGE_GAP_TOLERANCE = 1.5
|
const BRIDGE_GAP_TOLERANCE = 1.5
|
||||||
# How long we show the plain bridge frame after attaching before leaning towards
|
|
||||||
# the surface we're holding towards.
|
|
||||||
const BRIDGE_SETTLE_TIME = 0.15
|
|
||||||
const IN_AIR_FRAME = 8 # The InAir animation's frame.
|
const IN_AIR_FRAME = 8 # The InAir animation's frame.
|
||||||
|
|
||||||
###############
|
###############
|
||||||
|
|
@ -181,10 +154,6 @@ var bridgeAxis := Vector2.RIGHT # RIGHT between walls, DOWN between floor and ce
|
||||||
var bridgeHoldSide := 0.0 # Which way along bridgeAxis we're holding (1, -1), or 0.
|
var bridgeHoldSide := 0.0 # Which way along bridgeAxis we're holding (1, -1), or 0.
|
||||||
var timeSpentLeavingBridge := 0.0
|
var timeSpentLeavingBridge := 0.0
|
||||||
var timeSpentDroppingFromBridge := 0.0
|
var timeSpentDroppingFromBridge := 0.0
|
||||||
# Between floor and ceiling, which one we're holding towards: -1 up, 1 down, or 0.
|
|
||||||
# Read by the AnimationTree to lean the column that way.
|
|
||||||
var bridgeLean := 0
|
|
||||||
var bridgeSettleTimeLeft := 0.0 # Until this runs out we don't lean (see BRIDGE_SETTLE_TIME).
|
|
||||||
|
|
||||||
var carriedItem: CarryItem = null # The item riding in our center, or null. Tubes drop it.
|
var carriedItem: CarryItem = null # The item riding in our center, or null. Tubes drop it.
|
||||||
|
|
||||||
|
|
@ -237,7 +206,7 @@ func _ready() -> void:
|
||||||
# they reform as from the sprite's offset, and that must not carry the shift.
|
# they reform as from the sprite's offset, and that must not carry the shift.
|
||||||
func _align_press_wall_sprite() -> void:
|
func _align_press_wall_sprite() -> void:
|
||||||
var targetPosition := spriteBasePosition
|
var targetPosition := spriteBasePosition
|
||||||
if sprite.frame in BRIDGE_FRAMES:
|
if sprite.frame == BRIDGE_FRAME or sprite.frame == BRIDGE_VERTICAL_FRAME:
|
||||||
# The sprite's offset lifts it off the surface we're on. Undo that so the
|
# The sprite's offset lifts it off the surface we're on. Undo that so the
|
||||||
# column sits centred on us, between the surfaces.
|
# column sits centred on us, between the surfaces.
|
||||||
targetPosition -= sprite.offset.rotated(sprite.rotation).round()
|
targetPosition -= sprite.offset.rotated(sprite.rotation).round()
|
||||||
|
|
@ -667,39 +636,21 @@ func _begin_bridge(normal: Vector2, ownPoint: Vector2, otherPoint: Vector2) -> v
|
||||||
# We're still holding away from the surface we left, towards the one across.
|
# We're still holding away from the surface we left, towards the one across.
|
||||||
# Keep holding and we cross over to it after HOLD_TIME, like any other hold.
|
# Keep holding and we cross over to it after HOLD_TIME, like any other hold.
|
||||||
bridgeHoldSide = signf(normal.dot(bridgeAxis))
|
bridgeHoldSide = signf(normal.dot(bridgeAxis))
|
||||||
bridgeSettleTimeLeft = BRIDGE_SETTLE_TIME
|
|
||||||
_update_bridge_lean()
|
|
||||||
velocity = Vector2.ZERO
|
velocity = Vector2.ZERO
|
||||||
|
|
||||||
# Halfway between the surfaces, staying put the other way.
|
# Halfway between the surfaces, staying put the other way.
|
||||||
var middle := (ownPoint + otherPoint) / 2.0
|
var middle := (ownPoint + otherPoint) / 2.0
|
||||||
global_position += bridgeAxis * (middle - global_position).dot(bridgeAxis)
|
global_position += bridgeAxis * (middle - global_position).dot(bridgeAxis)
|
||||||
_show_bridge_pose()
|
# Always drawn the same way round, whichever surface we came from, unflipped.
|
||||||
|
# Between walls, turned as for the left wall, which puts the frame's flat
|
||||||
|
# side on top. Between floor and ceiling, upright.
|
||||||
# Shows the bridge frame for bridgeAxis and bridgeLean, turned to suit.
|
|
||||||
# Always drawn the same way round, whichever surface we came from, unflipped.
|
|
||||||
func _show_bridge_pose() -> void:
|
|
||||||
sprite.flip_h = false
|
sprite.flip_h = false
|
||||||
if bridgeAxis == Vector2.RIGHT:
|
if bridgeAxis == Vector2.RIGHT:
|
||||||
# Turned as for the left wall, which puts the frame's flat side on top
|
|
||||||
# and its top on the right.
|
|
||||||
_set_sprite_rotation(_rotation_for(Vector2.RIGHT))
|
_set_sprite_rotation(_rotation_for(Vector2.RIGHT))
|
||||||
if bridgeLean < 0:
|
_show_pose(&"Bridge", BRIDGE_FRAME)
|
||||||
_show_pose(&"BridgeLeanLeft", BRIDGE_LEAN_LEFT_MID_FRAME)
|
|
||||||
elif bridgeLean > 0:
|
|
||||||
_show_pose(&"BridgeLeanRight", BRIDGE_LEAN_RIGHT_MID_FRAME)
|
|
||||||
else:
|
|
||||||
_show_pose(&"Bridge", BRIDGE_FRAME)
|
|
||||||
else:
|
else:
|
||||||
# Upright.
|
|
||||||
_set_sprite_rotation(0.0)
|
_set_sprite_rotation(0.0)
|
||||||
if bridgeLean < 0:
|
_show_pose(&"BridgeVertical", BRIDGE_VERTICAL_FRAME)
|
||||||
_show_pose(&"BridgeVerticalUp", BRIDGE_VERTICAL_UP_MID_FRAME)
|
|
||||||
elif bridgeLean > 0:
|
|
||||||
_show_pose(&"BridgeVerticalDown", BRIDGE_VERTICAL_DOWN_MID_FRAME)
|
|
||||||
else:
|
|
||||||
_show_pose(&"BridgeVertical", BRIDGE_VERTICAL_FRAME)
|
|
||||||
|
|
||||||
|
|
||||||
# Holding towards either surface for HOLD_TIME sticks us to it and lets go of
|
# Holding towards either surface for HOLD_TIME sticks us to it and lets go of
|
||||||
|
|
@ -718,11 +669,6 @@ func _update_bridge(delta: float, moveInput: Vector2) -> void:
|
||||||
else:
|
else:
|
||||||
timeSpentLeavingBridge = 0.0
|
timeSpentLeavingBridge = 0.0
|
||||||
bridgeHoldSide = side
|
bridgeHoldSide = side
|
||||||
bridgeSettleTimeLeft = maxf(bridgeSettleTimeLeft - delta, 0.0)
|
|
||||||
var previousLean := bridgeLean
|
|
||||||
_update_bridge_lean()
|
|
||||||
if bridgeLean != previousLean:
|
|
||||||
_show_bridge_pose() # The frame and its turn change together.
|
|
||||||
|
|
||||||
# Between walls only down drops us (bridgeAxis.orthogonal() is up there).
|
# Between walls only down drops us (bridgeAxis.orthogonal() is up there).
|
||||||
var holdingToDrop := along == 0.0 and across != 0.0
|
var holdingToDrop := along == 0.0 and across != 0.0
|
||||||
|
|
@ -739,13 +685,6 @@ func _update_bridge(delta: float, moveInput: Vector2) -> void:
|
||||||
_drop_from_bridge()
|
_drop_from_bridge()
|
||||||
|
|
||||||
|
|
||||||
# Leans the column towards the surface we're holding towards. The hold side is
|
|
||||||
# along bridgeAxis: -1 left, 1 right between walls; -1 up, 1 down between floor
|
|
||||||
# and ceiling. Straight for a moment after attaching (BRIDGE_SETTLE_TIME).
|
|
||||||
func _update_bridge_lean() -> void:
|
|
||||||
bridgeLean = 0 if bridgeSettleTimeLeft > 0.0 else int(bridgeHoldSide)
|
|
||||||
|
|
||||||
|
|
||||||
# Lets go of both surfaces and falls from where we are.
|
# Lets go of both surfaces and falls from where we are.
|
||||||
func _drop_from_bridge() -> void:
|
func _drop_from_bridge() -> void:
|
||||||
isBridging = false
|
isBridging = false
|
||||||
|
|
@ -870,7 +809,7 @@ func _find_edge_corner(normal: Vector2, direction: Vector2, reach: float) -> Var
|
||||||
return corner
|
return corner
|
||||||
|
|
||||||
|
|
||||||
# Stops us with our leading sensor at an edge, until we've held towards it for EDGE_HOLD_TIME.
|
# Stops us with our leading sensor at an edge, until we've held towards it for HOLD_TIME.
|
||||||
func _hold_at_edge(delta: float) -> void:
|
func _hold_at_edge(delta: float) -> void:
|
||||||
var normal := _get_surface_normal()
|
var normal := _get_surface_normal()
|
||||||
var tangent := normal.orthogonal()
|
var tangent := normal.orthogonal()
|
||||||
|
|
@ -889,7 +828,7 @@ func _hold_at_edge(delta: float) -> void:
|
||||||
timeSpentHoldingEdge = 0.0
|
timeSpentHoldingEdge = 0.0
|
||||||
return
|
return
|
||||||
|
|
||||||
if timeSpentHoldingEdge >= EDGE_HOLD_TIME:
|
if timeSpentHoldingEdge >= HOLD_TIME:
|
||||||
return
|
return
|
||||||
timeSpentHoldingEdge += delta
|
timeSpentHoldingEdge += delta
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,38 +29,6 @@ tracks/0/keys = {
|
||||||
"values": [10]
|
"values": [10]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_BridgeLeanRight"]
|
|
||||||
resource_name = "BridgeLeanRight"
|
|
||||||
length = 0.2
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Sprite2D:frame")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.1),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [18, 11]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_BridgeLeanLeft"]
|
|
||||||
resource_name = "BridgeLeanLeft"
|
|
||||||
length = 0.2
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Sprite2D:frame")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.1),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [19, 12]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_BridgeVertical"]
|
[sub_resource type="Animation" id="Animation_BridgeVertical"]
|
||||||
resource_name = "BridgeVertical"
|
resource_name = "BridgeVertical"
|
||||||
length = 0.2
|
length = 0.2
|
||||||
|
|
@ -75,39 +43,7 @@ tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [13]
|
"values": [11]
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_BridgeVerticalDown"]
|
|
||||||
resource_name = "BridgeVerticalDown"
|
|
||||||
length = 0.2
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Sprite2D:frame")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.1),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [14, 15]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_BridgeVerticalUp"]
|
|
||||||
resource_name = "BridgeVerticalUp"
|
|
||||||
length = 0.2
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Sprite2D:frame")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.1),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [16, 17]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_Crouch"]
|
[sub_resource type="Animation" id="Animation_Crouch"]
|
||||||
|
|
@ -245,11 +181,7 @@ tracks/0/keys = {
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_slime"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_slime"]
|
||||||
_data = {
|
_data = {
|
||||||
&"Bridge": SubResource("Animation_Bridge"),
|
&"Bridge": SubResource("Animation_Bridge"),
|
||||||
&"BridgeLeanLeft": SubResource("Animation_BridgeLeanLeft"),
|
|
||||||
&"BridgeLeanRight": SubResource("Animation_BridgeLeanRight"),
|
|
||||||
&"BridgeVertical": SubResource("Animation_BridgeVertical"),
|
&"BridgeVertical": SubResource("Animation_BridgeVertical"),
|
||||||
&"BridgeVerticalDown": SubResource("Animation_BridgeVerticalDown"),
|
|
||||||
&"BridgeVerticalUp": SubResource("Animation_BridgeVerticalUp"),
|
|
||||||
&"Crouch": SubResource("Animation_Crouch"),
|
&"Crouch": SubResource("Animation_Crouch"),
|
||||||
&"Idle": SubResource("Animation_Idle"),
|
&"Idle": SubResource("Animation_Idle"),
|
||||||
&"InAir": SubResource("Animation_InAir"),
|
&"InAir": SubResource("Animation_InAir"),
|
||||||
|
|
@ -263,21 +195,9 @@ _data = {
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimNode_Bridge"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimNode_Bridge"]
|
||||||
animation = &"Bridge"
|
animation = &"Bridge"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimNode_BridgeLeanLeft"]
|
|
||||||
animation = &"BridgeLeanLeft"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimNode_BridgeLeanRight"]
|
|
||||||
animation = &"BridgeLeanRight"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimNode_BridgeVertical"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimNode_BridgeVertical"]
|
||||||
animation = &"BridgeVertical"
|
animation = &"BridgeVertical"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimNode_BridgeVerticalDown"]
|
|
||||||
animation = &"BridgeVerticalDown"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimNode_BridgeVerticalUp"]
|
|
||||||
animation = &"BridgeVerticalUp"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimNode_Crouch"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimNode_Crouch"]
|
||||||
animation = &"Crouch"
|
animation = &"Crouch"
|
||||||
|
|
||||||
|
|
@ -474,87 +394,15 @@ advance_expression = "isPressingIntoSurface and not isCrawling and not isHolding
|
||||||
advance_mode = 2
|
advance_mode = 2
|
||||||
advance_expression = "not isBridging"
|
advance_expression = "not isBridging"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_Bridge_BridgeLeanLeft"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean < 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_Bridge_BridgeLeanRight"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean > 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeLeanLeft_Bridge"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean == 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeLeanLeft_BridgeLeanRight"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean > 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeLeanLeft_Idle"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "not isBridging"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeLeanRight_Bridge"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean == 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeLeanRight_BridgeLeanLeft"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean < 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeLeanRight_Idle"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "not isBridging"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVertical_Idle"]
|
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVertical_Idle"]
|
||||||
advance_mode = 2
|
advance_mode = 2
|
||||||
advance_expression = "not isBridging"
|
advance_expression = "not isBridging"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVertical_BridgeVerticalUp"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean < 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVertical_BridgeVerticalDown"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean > 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVerticalUp_BridgeVertical"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean == 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVerticalUp_BridgeVerticalDown"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean > 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVerticalUp_Idle"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "not isBridging"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVerticalDown_BridgeVertical"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean == 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVerticalDown_BridgeVerticalUp"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "isBridging and bridgeLean < 0"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="Transition_BridgeVerticalDown_Idle"]
|
|
||||||
advance_mode = 2
|
|
||||||
advance_expression = "not isBridging"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_slime"]
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_slime"]
|
||||||
states/BridgeVertical/node = SubResource("AnimNode_BridgeVertical")
|
states/BridgeVertical/node = SubResource("AnimNode_BridgeVertical")
|
||||||
states/BridgeVertical/position = Vector2(1150, 300)
|
states/BridgeVertical/position = Vector2(1150, 300)
|
||||||
states/BridgeVerticalDown/node = SubResource("AnimNode_BridgeVerticalDown")
|
|
||||||
states/BridgeVerticalDown/position = Vector2(1400, 400)
|
|
||||||
states/BridgeVerticalUp/node = SubResource("AnimNode_BridgeVerticalUp")
|
|
||||||
states/BridgeVerticalUp/position = Vector2(1400, 200)
|
|
||||||
states/Bridge/node = SubResource("AnimNode_Bridge")
|
states/Bridge/node = SubResource("AnimNode_Bridge")
|
||||||
states/Bridge/position = Vector2(900, 300)
|
states/Bridge/position = Vector2(900, 300)
|
||||||
states/BridgeLeanRight/node = SubResource("AnimNode_BridgeLeanRight")
|
|
||||||
states/BridgeLeanRight/position = Vector2(1000, 500)
|
|
||||||
states/BridgeLeanLeft/node = SubResource("AnimNode_BridgeLeanLeft")
|
|
||||||
states/BridgeLeanLeft/position = Vector2(800, 500)
|
|
||||||
states/Crouch/node = SubResource("AnimNode_Crouch")
|
states/Crouch/node = SubResource("AnimNode_Crouch")
|
||||||
states/Crouch/position = Vector2(150, 300)
|
states/Crouch/position = Vector2(150, 300)
|
||||||
states/Idle/node = SubResource("AnimNode_Idle")
|
states/Idle/node = SubResource("AnimNode_Idle")
|
||||||
|
|
@ -570,7 +418,7 @@ states/ReachX/position = Vector2(650, 300)
|
||||||
states/ReachY/node = SubResource("AnimNode_ReachY")
|
states/ReachY/node = SubResource("AnimNode_ReachY")
|
||||||
states/ReachY/position = Vector2(400, 300)
|
states/ReachY/position = Vector2(400, 300)
|
||||||
states/Start/position = Vector2(150, 100)
|
states/Start/position = Vector2(150, 100)
|
||||||
transitions = ["Start", "Idle", SubResource("Transition_Start"), "Idle", "Moving", SubResource("Transition_Idle_Moving"), "Idle", "InAir", SubResource("Transition_Idle_InAir"), "Idle", "ReachX", SubResource("Transition_Idle_ReachX"), "Idle", "ReachY", SubResource("Transition_Idle_ReachY"), "Idle", "Crouch", SubResource("Transition_Idle_Crouch"), "Moving", "Idle", SubResource("Transition_Moving_Idle"), "Moving", "InAir", SubResource("Transition_Moving_InAir"), "Moving", "ReachX", SubResource("Transition_Moving_ReachX"), "Moving", "ReachY", SubResource("Transition_Moving_ReachY"), "Moving", "Crouch", SubResource("Transition_Moving_Crouch"), "InAir", "Idle", SubResource("Transition_InAir_Idle"), "InAir", "Moving", SubResource("Transition_InAir_Moving"), "InAir", "ReachX", SubResource("Transition_InAir_ReachX"), "InAir", "ReachY", SubResource("Transition_InAir_ReachY"), "InAir", "Crouch", SubResource("Transition_InAir_Crouch"), "ReachX", "Idle", SubResource("Transition_ReachX_Idle"), "ReachX", "Moving", SubResource("Transition_ReachX_Moving"), "ReachX", "InAir", SubResource("Transition_ReachX_InAir"), "ReachX", "ReachY", SubResource("Transition_ReachX_ReachY"), "ReachX", "Crouch", SubResource("Transition_ReachX_Crouch"), "ReachY", "Idle", SubResource("Transition_ReachY_Idle"), "ReachY", "Moving", SubResource("Transition_ReachY_Moving"), "ReachY", "InAir", SubResource("Transition_ReachY_InAir"), "ReachY", "ReachX", SubResource("Transition_ReachY_ReachX"), "ReachY", "Crouch", SubResource("Transition_ReachY_Crouch"), "Crouch", "Idle", SubResource("Transition_Crouch_Idle"), "Crouch", "Moving", SubResource("Transition_Crouch_Moving"), "Crouch", "InAir", SubResource("Transition_Crouch_InAir"), "Crouch", "ReachX", SubResource("Transition_Crouch_ReachX"), "Crouch", "ReachY", SubResource("Transition_Crouch_ReachY"), "Idle", "PressWall", SubResource("Transition_Idle_PressWall"), "Moving", "PressWall", SubResource("Transition_Moving_PressWall"), "InAir", "PressWall", SubResource("Transition_InAir_PressWall"), "ReachX", "PressWall", SubResource("Transition_ReachX_PressWall"), "ReachY", "PressWall", SubResource("Transition_ReachY_PressWall"), "Crouch", "PressWall", SubResource("Transition_Crouch_PressWall"), "PressWall", "Idle", SubResource("Transition_PressWall_Idle"), "PressWall", "Moving", SubResource("Transition_PressWall_Moving"), "PressWall", "InAir", SubResource("Transition_PressWall_InAir"), "PressWall", "ReachX", SubResource("Transition_PressWall_ReachX"), "PressWall", "ReachY", SubResource("Transition_PressWall_ReachY"), "PressWall", "Crouch", SubResource("Transition_PressWall_Crouch"), "Bridge", "Idle", SubResource("Transition_Bridge_Idle"), "Bridge", "BridgeLeanLeft", SubResource("Transition_Bridge_BridgeLeanLeft"), "Bridge", "BridgeLeanRight", SubResource("Transition_Bridge_BridgeLeanRight"), "BridgeLeanLeft", "Bridge", SubResource("Transition_BridgeLeanLeft_Bridge"), "BridgeLeanLeft", "BridgeLeanRight", SubResource("Transition_BridgeLeanLeft_BridgeLeanRight"), "BridgeLeanLeft", "Idle", SubResource("Transition_BridgeLeanLeft_Idle"), "BridgeLeanRight", "Bridge", SubResource("Transition_BridgeLeanRight_Bridge"), "BridgeLeanRight", "BridgeLeanLeft", SubResource("Transition_BridgeLeanRight_BridgeLeanLeft"), "BridgeLeanRight", "Idle", SubResource("Transition_BridgeLeanRight_Idle"), "BridgeVertical", "Idle", SubResource("Transition_BridgeVertical_Idle"), "BridgeVertical", "BridgeVerticalUp", SubResource("Transition_BridgeVertical_BridgeVerticalUp"), "BridgeVertical", "BridgeVerticalDown", SubResource("Transition_BridgeVertical_BridgeVerticalDown"), "BridgeVerticalUp", "BridgeVertical", SubResource("Transition_BridgeVerticalUp_BridgeVertical"), "BridgeVerticalUp", "BridgeVerticalDown", SubResource("Transition_BridgeVerticalUp_BridgeVerticalDown"), "BridgeVerticalUp", "Idle", SubResource("Transition_BridgeVerticalUp_Idle"), "BridgeVerticalDown", "BridgeVertical", SubResource("Transition_BridgeVerticalDown_BridgeVertical"), "BridgeVerticalDown", "BridgeVerticalUp", SubResource("Transition_BridgeVerticalDown_BridgeVerticalUp"), "BridgeVerticalDown", "Idle", SubResource("Transition_BridgeVerticalDown_Idle")]
|
transitions = ["Start", "Idle", SubResource("Transition_Start"), "Idle", "Moving", SubResource("Transition_Idle_Moving"), "Idle", "InAir", SubResource("Transition_Idle_InAir"), "Idle", "ReachX", SubResource("Transition_Idle_ReachX"), "Idle", "ReachY", SubResource("Transition_Idle_ReachY"), "Idle", "Crouch", SubResource("Transition_Idle_Crouch"), "Moving", "Idle", SubResource("Transition_Moving_Idle"), "Moving", "InAir", SubResource("Transition_Moving_InAir"), "Moving", "ReachX", SubResource("Transition_Moving_ReachX"), "Moving", "ReachY", SubResource("Transition_Moving_ReachY"), "Moving", "Crouch", SubResource("Transition_Moving_Crouch"), "InAir", "Idle", SubResource("Transition_InAir_Idle"), "InAir", "Moving", SubResource("Transition_InAir_Moving"), "InAir", "ReachX", SubResource("Transition_InAir_ReachX"), "InAir", "ReachY", SubResource("Transition_InAir_ReachY"), "InAir", "Crouch", SubResource("Transition_InAir_Crouch"), "ReachX", "Idle", SubResource("Transition_ReachX_Idle"), "ReachX", "Moving", SubResource("Transition_ReachX_Moving"), "ReachX", "InAir", SubResource("Transition_ReachX_InAir"), "ReachX", "ReachY", SubResource("Transition_ReachX_ReachY"), "ReachX", "Crouch", SubResource("Transition_ReachX_Crouch"), "ReachY", "Idle", SubResource("Transition_ReachY_Idle"), "ReachY", "Moving", SubResource("Transition_ReachY_Moving"), "ReachY", "InAir", SubResource("Transition_ReachY_InAir"), "ReachY", "ReachX", SubResource("Transition_ReachY_ReachX"), "ReachY", "Crouch", SubResource("Transition_ReachY_Crouch"), "Crouch", "Idle", SubResource("Transition_Crouch_Idle"), "Crouch", "Moving", SubResource("Transition_Crouch_Moving"), "Crouch", "InAir", SubResource("Transition_Crouch_InAir"), "Crouch", "ReachX", SubResource("Transition_Crouch_ReachX"), "Crouch", "ReachY", SubResource("Transition_Crouch_ReachY"), "Idle", "PressWall", SubResource("Transition_Idle_PressWall"), "Moving", "PressWall", SubResource("Transition_Moving_PressWall"), "InAir", "PressWall", SubResource("Transition_InAir_PressWall"), "ReachX", "PressWall", SubResource("Transition_ReachX_PressWall"), "ReachY", "PressWall", SubResource("Transition_ReachY_PressWall"), "Crouch", "PressWall", SubResource("Transition_Crouch_PressWall"), "PressWall", "Idle", SubResource("Transition_PressWall_Idle"), "PressWall", "Moving", SubResource("Transition_PressWall_Moving"), "PressWall", "InAir", SubResource("Transition_PressWall_InAir"), "PressWall", "ReachX", SubResource("Transition_PressWall_ReachX"), "PressWall", "ReachY", SubResource("Transition_PressWall_ReachY"), "PressWall", "Crouch", SubResource("Transition_PressWall_Crouch"), "Bridge", "Idle", SubResource("Transition_Bridge_Idle"), "BridgeVertical", "Idle", SubResource("Transition_BridgeVertical_Idle")]
|
||||||
graph_offset = Vector2(0, -150)
|
graph_offset = Vector2(0, -150)
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D" unique_id=150873177]
|
[node name="Player" type="CharacterBody2D" unique_id=150873177]
|
||||||
|
|
@ -580,8 +428,7 @@ landSounds = Array[AudioStream]([ExtResource("3_land1"), ExtResource("4_land2"),
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=402647784]
|
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=402647784]
|
||||||
texture = ExtResource("5_4m0gv")
|
texture = ExtResource("5_4m0gv")
|
||||||
offset = Vector2(0, -6)
|
offset = Vector2(0, -6)
|
||||||
hframes = 5
|
hframes = 12
|
||||||
vframes = 4
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1379572123]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1379572123]
|
||||||
shape = SubResource("CircleShape2D_eovys")
|
shape = SubResource("CircleShape2D_eovys")
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ extends Camera2D
|
||||||
class_name RoomCamera
|
class_name RoomCamera
|
||||||
|
|
||||||
# Splits the level into screen-sized rooms and snaps to whichever room the
|
# Splits the level into screen-sized rooms and snaps to whichever room the
|
||||||
# target is in: the camera never scrolls, it just cuts to the
|
# target is in, VVVVVV style: the camera never scrolls, it just cuts to the
|
||||||
# next screen when the target crosses a room border.
|
# 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
|
# Room (0, 0) has its top-left corner at the level's origin, room (1, 0) is the
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue