Prototype code for two pipes: one that requires manual movement, and one that automatically moves the player along the path.
This commit is contained in:
parent
f13ca3f44f
commit
d9c86a181d
8 changed files with 581 additions and 77 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
|
@ -8,39 +8,85 @@ texture_region_size = Vector2i(32, 32)
|
|||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
1:0/0 = 0
|
||||
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -2, -16, -2)
|
||||
1:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(-16, 2, 16, 2, 16, 16, -16, 16)
|
||||
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -3, -16, -3)
|
||||
1:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(-16, 3, 16, 3, 16, 16, -16, 16)
|
||||
1:0/0/custom_data_0 = 10
|
||||
1:0/1 = 1
|
||||
1:0/1/modulate = Color(0.6, 1, 0.75, 1)
|
||||
1:0/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -3, -16, -3)
|
||||
1:0/1/physics_layer_0/polygon_1/points = PackedVector2Array(-16, 3, 16, 3, 16, 16, -16, 16)
|
||||
1:0/1/custom_data_0 = 10
|
||||
1:0/1/custom_data_1 = true
|
||||
2:0/0 = 0
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -2, -16, -2, 16, -16, 16)
|
||||
2:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(2, -16, 16, -16, 16, 16, 2, 16)
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3, -16, -3, 16, -16, 16)
|
||||
2:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(3, -16, 16, -16, 16, 16, 3, 16)
|
||||
2:0/0/custom_data_0 = 5
|
||||
2:0/1 = 1
|
||||
2:0/1/modulate = Color(0.6, 1, 0.75, 1)
|
||||
2:0/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3, -16, -3, 16, -16, 16)
|
||||
2:0/1/physics_layer_0/polygon_1/points = PackedVector2Array(3, -16, 16, -16, 16, 16, 3, 16)
|
||||
2:0/1/custom_data_0 = 5
|
||||
2:0/1/custom_data_1 = true
|
||||
3:0/0 = 0
|
||||
3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -2, -16, -2, -2, -16, -2)
|
||||
3:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(2, -16, 16, -16, 16, -2, 2, -2)
|
||||
3:0/0/physics_layer_0/polygon_2/points = PackedVector2Array(-16, 2, -2, 2, -2, 16, -16, 16)
|
||||
3:0/0/physics_layer_0/polygon_3/points = PackedVector2Array(2, 2, 16, 2, 16, 16, 2, 16)
|
||||
3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3, -16, -3, -3, -16, -3)
|
||||
3:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(3, -16, 16, -16, 16, -3, 3, -3)
|
||||
3:0/0/physics_layer_0/polygon_2/points = PackedVector2Array(-16, 3, -3, 3, -3, 16, -16, 16)
|
||||
3:0/0/physics_layer_0/polygon_3/points = PackedVector2Array(3, 3, 16, 3, 16, 16, 3, 16)
|
||||
3:0/0/custom_data_0 = 15
|
||||
3:0/1 = 1
|
||||
3:0/1/modulate = Color(0.6, 1, 0.75, 1)
|
||||
3:0/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3, -16, -3, -3, -16, -3)
|
||||
3:0/1/physics_layer_0/polygon_1/points = PackedVector2Array(3, -16, 16, -16, 16, -3, 3, -3)
|
||||
3:0/1/physics_layer_0/polygon_2/points = PackedVector2Array(-16, 3, -3, 3, -3, 16, -16, 16)
|
||||
3:0/1/physics_layer_0/polygon_3/points = PackedVector2Array(3, 3, 16, 3, 16, 16, 3, 16)
|
||||
3:0/1/custom_data_0 = 15
|
||||
3:0/1/custom_data_1 = true
|
||||
4:0/0 = 0
|
||||
4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -2, -16, -2, 2, 16, 2, 16, 16, -16, 16)
|
||||
4:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(2, -16, 16, -16, 16, -2, 2, -2)
|
||||
4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3, -16, -3, 3, 16, 3, 16, 16, -16, 16)
|
||||
4:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(3, -16, 16, -16, 16, -3, 3, -3)
|
||||
4:0/0/custom_data_0 = 3
|
||||
4:0/1 = 1
|
||||
4:0/1/modulate = Color(0.6, 1, 0.75, 1)
|
||||
4:0/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3, -16, -3, 3, 16, 3, 16, 16, -16, 16)
|
||||
4:0/1/physics_layer_0/polygon_1/points = PackedVector2Array(3, -16, 16, -16, 16, -3, 3, -3)
|
||||
4:0/1/custom_data_0 = 3
|
||||
4:0/1/custom_data_1 = true
|
||||
5:0/0 = 0
|
||||
5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(2, -16, 16, -16, 16, 16, -16, 16, -16, 2, 2, 2)
|
||||
5:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(-16, -16, -2, -16, -2, -2, -16, -2)
|
||||
5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -16, 16, -16, 16, 16, -16, 16, -16, 3, 3, 3)
|
||||
5:0/0/physics_layer_0/polygon_1/points = PackedVector2Array(-16, -16, -3, -16, -3, -3, -16, -3)
|
||||
5:0/0/custom_data_0 = 9
|
||||
5:0/1 = 1
|
||||
5:0/1/modulate = Color(0.6, 1, 0.75, 1)
|
||||
5:0/1/physics_layer_0/polygon_0/points = PackedVector2Array(3, -16, 16, -16, 16, 16, -16, 16, -16, 3, 3, 3)
|
||||
5:0/1/physics_layer_0/polygon_1/points = PackedVector2Array(-16, -16, -3, -16, -3, -3, -16, -3)
|
||||
5:0/1/custom_data_0 = 9
|
||||
5:0/1/custom_data_1 = true
|
||||
0:1/0 = 0
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, 2, 16, 2, -2, -16, -2)
|
||||
0:1/0/physics_layer_0/polygon_1/points = PackedVector2Array(-16, 2, -2, 2, -2, 16, -16, 16)
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, 3, 16, 3, -3, -16, -3)
|
||||
0:1/0/physics_layer_0/polygon_1/points = PackedVector2Array(-16, 3, -3, 3, -3, 16, -16, 16)
|
||||
0:1/0/custom_data_0 = 12
|
||||
0:1/1 = 1
|
||||
0:1/1/modulate = Color(0.6, 1, 0.75, 1)
|
||||
0:1/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, 3, 16, 3, -3, -16, -3)
|
||||
0:1/1/physics_layer_0/polygon_1/points = PackedVector2Array(-16, 3, -3, 3, -3, 16, -16, 16)
|
||||
0:1/1/custom_data_0 = 12
|
||||
0:1/1/custom_data_1 = true
|
||||
1:1/0 = 0
|
||||
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -2, -2, -2, -2, 16, -16, 16)
|
||||
1:1/0/physics_layer_0/polygon_1/points = PackedVector2Array(2, 2, 16, 2, 16, 16, 2, 16)
|
||||
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -3, -3, -3, -3, 16, -16, 16)
|
||||
1:1/0/physics_layer_0/polygon_1/points = PackedVector2Array(3, 3, 16, 3, 16, 16, 3, 16)
|
||||
1:1/0/custom_data_0 = 6
|
||||
1:1/1 = 1
|
||||
1:1/1/modulate = Color(0.6, 1, 0.75, 1)
|
||||
1:1/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -3, -3, -3, -3, 16, -16, 16)
|
||||
1:1/1/physics_layer_0/polygon_1/points = PackedVector2Array(3, 3, 16, 3, 16, 16, 3, 16)
|
||||
1:1/1/custom_data_0 = 6
|
||||
1:1/1/custom_data_1 = true
|
||||
|
||||
[resource]
|
||||
tile_size = Vector2i(32, 32)
|
||||
physics_layer_0/collision_layer = 1
|
||||
custom_data_layer_0/name = "tube_openings"
|
||||
custom_data_layer_0/type = 2
|
||||
custom_data_layer_1/name = "tube_manual"
|
||||
custom_data_layer_1/type = 1
|
||||
sources/0 = SubResource("TileSetAtlasSource_0cw2b")
|
||||
|
|
|
|||
|
|
@ -45,19 +45,18 @@ const LAND_PITCH_MIN = 0.87
|
|||
const LAND_PITCH_MAX = 1.15
|
||||
|
||||
# Tubes are tiles too narrow for us, tagged in their TileSet with which sides are
|
||||
# open (the "tube_openings" custom data). Moving into a tube's mouth squeezes us
|
||||
# through as a stream of pixels, and we reform past the other end.
|
||||
# open (the "tube_openings" custom data). Holding into a tube's mouth squeezes us
|
||||
# in as pixels. An ordinary tube streams us through to the other end
|
||||
# (PixelStream). A manual one ("tube_manual" tiles) lets the player steer us
|
||||
# through it, round corners and either way at crossings (TubeSteer).
|
||||
const TUBE_DATA_LAYER = "tube_openings"
|
||||
const TUBE_OPEN_UP = 1
|
||||
const TUBE_OPEN_RIGHT = 2
|
||||
const TUBE_OPEN_DOWN = 4
|
||||
const TUBE_OPEN_LEFT = 8
|
||||
const TUBE_WIDTH = 4.0 # The channel drawn through the tiles in LevelTiles.png.
|
||||
const TUBE_WIDTH = 6.0 # The channel drawn through the tiles in LevelTiles.png.
|
||||
const TUBE_ENTRY_REACH = 2.0 # How close our side must be to a tube mouth to go in.
|
||||
const TUBE_MAX_TILES = 256 # Give up following a tube this long.
|
||||
# Coming out of a tube sideways with a floor this close below, land on it
|
||||
# instead of sticking to the wall.
|
||||
const TUBE_EXIT_FLOOR_REACH = 8.0
|
||||
const TUBE_REENTRY_DELAY = 0.3 # So we don't dive straight back in.
|
||||
const TUBE_ENTER_HOLD_TIME = 0.35 # How long to press into a mouth before we squeeze in.
|
||||
# How straight into a mouth we must press (dot product with the way in; 0.9 is
|
||||
|
|
@ -110,9 +109,9 @@ var isReachingAway := false # Holding away from the surface, counting towards le
|
|||
var isSqueezingIntoTube := false # Holding into a tube's mouth, about to go in.
|
||||
|
||||
var isInTube := false
|
||||
var tubePixels: PixelStream # Our pixels on their way through.
|
||||
var tubeExitPosition := Vector2.ZERO # Where we reappear.
|
||||
var tubeExitNormal := Vector2.UP # The surface we'll be on when we do.
|
||||
var tubePixels: PixelStream # Our pixels streaming through an ordinary tube, or null.
|
||||
var tubeSteer: TubeSteer # Our pixels being steered through a manual tube, or null.
|
||||
var tubeExitPose := {} # Where the stream comes out (see _tube_exit_pose).
|
||||
var tubeReentryCooldown := 0.0
|
||||
var timeSpentSqueezingIntoTube := 0.0
|
||||
var tubeLayers: Array[TileMapLayer] = [] # TileMapLayers whose tiles can be tubes.
|
||||
|
|
@ -155,8 +154,7 @@ func _physics_process(delta: float) -> void:
|
|||
var moveInput := Vector2(Input.get_axis("moveLeft", "moveRight"), Input.get_axis("moveDown", "moveUp"))
|
||||
|
||||
if isInTube:
|
||||
if tubePixels.isFinished:
|
||||
_exit_tube(delta)
|
||||
_update_tube(delta, moveInput)
|
||||
return
|
||||
if isWrapping:
|
||||
_update_wrap(delta)
|
||||
|
|
@ -705,10 +703,10 @@ func _settle_onto_surface(normal: Vector2, gap: float, delta: float) -> void:
|
|||
# TUBE_ENTER_HOLD_TIME squeezes us through it, if it leads somewhere we fit.
|
||||
# Meanwhile we hold still against the mouth. True while squeezing or once we're in.
|
||||
func _update_tube_squeeze(delta: float, moveInput: Vector2) -> bool:
|
||||
var path := PackedVector2Array()
|
||||
var tube := {}
|
||||
if tubeReentryCooldown <= 0.0 and _get_surface_normal() != Vector2.ZERO:
|
||||
path = _find_tube(moveInput)
|
||||
isSqueezingIntoTube = not path.is_empty()
|
||||
tube = _find_tube(moveInput)
|
||||
isSqueezingIntoTube = not tube.is_empty()
|
||||
if not isSqueezingIntoTube:
|
||||
timeSpentSqueezingIntoTube = 0.0
|
||||
return false
|
||||
|
|
@ -717,7 +715,7 @@ func _update_tube_squeeze(delta: float, moveInput: Vector2) -> bool:
|
|||
if timeSpentSqueezingIntoTube >= TUBE_ENTER_HOLD_TIME:
|
||||
timeSpentSqueezingIntoTube = 0.0
|
||||
isSqueezingIntoTube = false
|
||||
_enter_tube(path)
|
||||
_enter_tube(tube)
|
||||
return true
|
||||
|
||||
velocity = Vector2.ZERO
|
||||
|
|
@ -727,21 +725,24 @@ func _update_tube_squeeze(delta: float, moveInput: Vector2) -> bool:
|
|||
return true
|
||||
|
||||
|
||||
# The path of a tube whose mouth we're pressing straight into, if it leads
|
||||
# somewhere we fit. Empty if there isn't one. Only straight in: on the floor
|
||||
# beside a wall with a mouth in it, up and towards the wall climbs the wall.
|
||||
func _find_tube(moveInput: Vector2) -> PackedVector2Array:
|
||||
# The tube whose mouth we're pressing straight into, if we can go in: {layer,
|
||||
# cell, direction (into the tube)}, plus .path through it for an ordinary tube.
|
||||
# Empty if there isn't one. Only straight in: on the floor beside a wall with a
|
||||
# mouth in it, up and towards the wall climbs the wall.
|
||||
# Ordinary tubes must lead somewhere we fit. Manual ones needn't: we can always
|
||||
# back out.
|
||||
func _find_tube(moveInput: Vector2) -> Dictionary:
|
||||
if moveInput == Vector2.ZERO:
|
||||
return PackedVector2Array()
|
||||
return {}
|
||||
var inputDirection := Vector2(moveInput.x, -moveInput.y).normalized() # Up is negative y.
|
||||
for direction: Vector2 in [Vector2.UP, Vector2.RIGHT, Vector2.DOWN, Vector2.LEFT]:
|
||||
if inputDirection.dot(direction) < TUBE_ENTER_MIN_ALIGNMENT:
|
||||
continue
|
||||
return _find_tube_towards(direction)
|
||||
return PackedVector2Array()
|
||||
return {}
|
||||
|
||||
|
||||
func _find_tube_towards(direction: Vector2) -> PackedVector2Array:
|
||||
func _find_tube_towards(direction: Vector2) -> Dictionary:
|
||||
var radius := _get_radius()
|
||||
var across := direction.orthogonal()
|
||||
var reach := radius + TUBE_ENTRY_REACH
|
||||
|
|
@ -757,10 +758,14 @@ func _find_tube_towards(direction: Vector2) -> PackedVector2Array:
|
|||
var toMouth := _tube_cell_point(layer, cell, -direction) - global_position
|
||||
if absf(toMouth.dot(across)) > radius or toMouth.dot(direction) > reach:
|
||||
continue
|
||||
var tube := {layer = layer, cell = cell, direction = direction}
|
||||
if TubeSteer.is_manual(layer, cell):
|
||||
return tube
|
||||
var path := _trace_tube(layer, cell, direction)
|
||||
if not path.is_empty() and not _tube_exit_pose(path).is_empty():
|
||||
return path
|
||||
return PackedVector2Array()
|
||||
if not path.is_empty() and not _tube_exit_pose_for(path).is_empty():
|
||||
tube.path = path
|
||||
return tube
|
||||
return {}
|
||||
|
||||
|
||||
# The tube's path from the mouth of `cell` we go in heading `direction`, round
|
||||
|
|
@ -791,41 +796,49 @@ func _trace_tube(layer: TileMapLayer, cell: Vector2i, direction: Vector2) -> Pac
|
|||
return PackedVector2Array()
|
||||
|
||||
|
||||
# Where we come out of the tube along `path`: .position (where the sprite
|
||||
# reforms), .normal (the surface we'll be stuck to) and .appearAt (where we
|
||||
# reappear, a pixel off it). Empty if there's no room for us.
|
||||
func _tube_exit_pose(path: PackedVector2Array) -> Dictionary:
|
||||
# Where we come out of the ordinary tube along `path` (see _tube_exit_pose).
|
||||
func _tube_exit_pose_for(path: PackedVector2Array) -> Dictionary:
|
||||
var exitMouth := path[path.size() - 1]
|
||||
var exitDirection := (exitMouth - path[path.size() - 2]).normalized().round()
|
||||
return _tube_exit_pose(exitMouth, exitDirection)
|
||||
|
||||
|
||||
# How we come out of a tube mouth facing `outward`: .spriteTransform (where the
|
||||
# sprite reforms), .normal (the surface we'll be stuck to) and .appearAt (where
|
||||
# we reappear, a pixel off it). Empty if there's no room for us.
|
||||
func _tube_exit_pose(mouth: Vector2, outward: Vector2) -> Dictionary:
|
||||
var radius := _get_radius()
|
||||
|
||||
# Come out stuck to the face the tube opens from, like after a wrap...
|
||||
var exitNormal := exitDirection
|
||||
var exitPosition := exitMouth + exitDirection * radius
|
||||
# ...unless it opens sideways just above a floor: land on that instead.
|
||||
if exitDirection.y == 0.0:
|
||||
var besideWall := exitMouth + exitDirection * (radius + 1)
|
||||
var floorHit := _cast_ray(besideWall, besideWall + Vector2.DOWN * (radius + TUBE_EXIT_FLOOR_REACH))
|
||||
if not floorHit.is_empty() and floorHit.normal.y < -0.5:
|
||||
exitNormal = Vector2.UP
|
||||
exitPosition = Vector2(besideWall.x, floorHit.position.y - radius)
|
||||
# Come out stuck to the face the tube opens from, like after a wrap. Even
|
||||
# with a floor right below a sideways mouth, we stick to the wall.
|
||||
var exitNormal := outward
|
||||
var exitPosition := mouth + outward * radius
|
||||
|
||||
# We reappear a pixel off the surface and settle onto it (see _exit_tube).
|
||||
var appearAt := exitPosition + exitNormal
|
||||
if not _is_spot_free(appearAt):
|
||||
return {}
|
||||
return {position = exitPosition, normal = exitNormal, appearAt = appearAt}
|
||||
return {spriteTransform = Transform2D(_rotation_for(exitNormal), exitPosition.round()),
|
||||
normal = exitNormal, appearAt = appearAt}
|
||||
|
||||
|
||||
# Starts streaming through the tube along `path` (one _find_tube gave us).
|
||||
func _enter_tube(path: PackedVector2Array) -> void:
|
||||
var exitPose := _tube_exit_pose(path)
|
||||
tubeExitPosition = exitPose.appearAt
|
||||
tubeExitNormal = exitPose.normal
|
||||
tubePixels = PixelStream.new()
|
||||
get_parent().add_child(tubePixels)
|
||||
var reformedSprite := Transform2D(_rotation_for(exitPose.normal), (exitPose.position as Vector2).round())
|
||||
tubePixels.start(sprite, path, TUBE_WIDTH, reformedSprite, REST_FRAME)
|
||||
# Turns us into pixels in the tube _find_tube gave us.
|
||||
func _enter_tube(tube: Dictionary) -> void:
|
||||
if tube.has("path"):
|
||||
tubeExitPose = _tube_exit_pose_for(tube.path)
|
||||
tubePixels = PixelStream.new()
|
||||
get_parent().add_child(tubePixels)
|
||||
tubePixels.start(sprite, tube.path, TUBE_WIDTH, tubeExitPose.spriteTransform, REST_FRAME)
|
||||
else:
|
||||
# Backing out of the mouth we went in by reforms us right here.
|
||||
var spriteTransform := sprite.get_global_transform()
|
||||
spriteTransform.origin = spriteTransform.origin.round() # Snapped like the renderer does.
|
||||
var entryPose := {spriteTransform = spriteTransform, normal = _get_surface_normal(),
|
||||
appearAt = global_position}
|
||||
tubeSteer = TubeSteer.new()
|
||||
get_parent().add_child(tubeSteer)
|
||||
tubeSteer.start(sprite, tube.layer, tube.cell, Vector2i(tube.direction), TUBE_WIDTH,
|
||||
entryPose, _tube_exit_pose, REST_FRAME)
|
||||
|
||||
isInTube = true
|
||||
velocity = Vector2.ZERO
|
||||
|
|
@ -841,19 +854,32 @@ func _enter_tube(path: PackedVector2Array) -> void:
|
|||
wrapSound.play()
|
||||
|
||||
|
||||
func _exit_tube(delta: float) -> void:
|
||||
tubePixels.queue_free()
|
||||
tubePixels = null
|
||||
func _update_tube(delta: float, moveInput: Vector2) -> void:
|
||||
if tubeSteer != null:
|
||||
tubeSteer.steer(Vector2(moveInput.x, -moveInput.y), delta) # Up is negative y.
|
||||
if tubeSteer.isFinished:
|
||||
var pose := tubeSteer.exitPose
|
||||
tubeSteer.queue_free()
|
||||
tubeSteer = null
|
||||
_exit_tube(pose, delta)
|
||||
elif tubePixels.isFinished:
|
||||
tubePixels.queue_free()
|
||||
tubePixels = null
|
||||
_exit_tube(tubeExitPose, delta)
|
||||
|
||||
|
||||
func _exit_tube(pose: Dictionary, delta: float) -> void:
|
||||
isInTube = false
|
||||
tubeReentryCooldown = TUBE_REENTRY_DELAY
|
||||
|
||||
# Visible again before anything below, as Godot ignores
|
||||
# reset_physics_interpolation() on hidden nodes.
|
||||
show()
|
||||
global_position = tubeExitPosition
|
||||
var normal: Vector2 = pose.normal
|
||||
global_position = pose.appearAt
|
||||
collisionShape.disabled = false
|
||||
_set_sprite_rotation(_rotation_for(tubeExitNormal))
|
||||
_settle_onto_surface(tubeExitNormal, 1.0, delta)
|
||||
_set_sprite_rotation(_rotation_for(normal))
|
||||
_settle_onto_surface(normal, 1.0, delta)
|
||||
velocity = Vector2.ZERO
|
||||
# A jump, not movement: don't smooth from where we went in. Without this the
|
||||
# sprite flashes up at the entrance for a frame.
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ func start(sprite: Sprite2D, path: PackedVector2Array, width: float, endTransfor
|
|||
# Where the sprite is drawn now: snapped to whole pixels like the renderer does.
|
||||
var startTransform := sprite.get_global_transform()
|
||||
startTransform.origin = startTransform.origin.round()
|
||||
var from := _get_frame_pixels(sprite, sprite.frame, startTransform)
|
||||
var to := _get_frame_pixels(sprite, endFrame, endTransform)
|
||||
var from := get_frame_pixels(sprite, sprite.frame, startTransform)
|
||||
var to := get_frame_pixels(sprite, endFrame, endTransform)
|
||||
if from.colors.is_empty() or to.colors.is_empty():
|
||||
isFinished = true
|
||||
return
|
||||
|
|
@ -57,8 +57,8 @@ func start(sprite: Sprite2D, path: PackedVector2Array, width: float, endTransfor
|
|||
|
||||
|
||||
# The frame's opaque pixels (black ones too: they're the eyes) as .positions
|
||||
# (global, through `spriteTransform`) and .colors.
|
||||
func _get_frame_pixels(sprite: Sprite2D, frame: int, spriteTransform: Transform2D) -> Dictionary:
|
||||
# (global, through `spriteTransform`) and .colors. TubeSteer uses this too.
|
||||
static func get_frame_pixels(sprite: Sprite2D, frame: int, spriteTransform: Transform2D) -> Dictionary:
|
||||
var positions := PackedVector2Array()
|
||||
var colors := PackedColorArray()
|
||||
var image := _get_frame_image(sprite, frame)
|
||||
|
|
|
|||
431
Effects/tube_steer.gd
Executable file
431
Effects/tube_steer.gd
Executable file
|
|
@ -0,0 +1,431 @@
|
|||
class_name TubeSteer
|
||||
extends Node2D
|
||||
|
||||
# The slime squeezed into a manual tube. An invisible "leader" rides the tubes'
|
||||
# centre lines, steered by the player's arrow keys, and the slime's pixels flow
|
||||
# along the trail it leaves, a few abreast, like a string of goo.
|
||||
#
|
||||
# Steering:
|
||||
# - The leader only moves while you press along the tube. Let go and it stops.
|
||||
# - At a bend or a crossing it takes the way you press. If nothing you press
|
||||
# leads anywhere, it waits there.
|
||||
# - Pressing towards a turn before you reach it carries you there to take it.
|
||||
# - Pressing back the way you came reverses. The pixels back up along the trail.
|
||||
# Back all the way out of the mouth you came in by and you reform where you were.
|
||||
# - Pressing out of any other mouth (one with room for the slime) pours the
|
||||
# pixels out, and they gather back into the slime's shape. Then isFinished
|
||||
# goes true and exitPose says where we came out.
|
||||
#
|
||||
# Tubes are tiles tagged with which sides are open ("tube_openings") and,
|
||||
# for this kind, "tube_manual". A mouth that opens onto another kind of tile,
|
||||
# or that has no room for the slime outside it, is a dead end.
|
||||
|
||||
const SPEED = 150.0 # How fast the leader moves while pressed, in px/s.
|
||||
const EXIT_SPEED = 200.0 # How fast the pixels pour out once we're leaving.
|
||||
const ROW_SPACING = 1.0 # Gap between rows of pixels in the trail.
|
||||
# How far past a mouth a pixel goes before it's back in its place in the slime.
|
||||
const GATHER_DISTANCE = 24.0
|
||||
# How much of the input must point along a way for us to move along it (0.5 lets
|
||||
# diagonals pick either way).
|
||||
const MIN_PULL = 0.5
|
||||
const MAX_TILES = 1024 # Stop mapping a tube network this big.
|
||||
const MAX_NODES_PER_FRAME = 8
|
||||
const EPSILON = 0.001
|
||||
const OUT = -1 # A "way on" from a mouth: out of the tube.
|
||||
const SHOW_LEADER = false # Draw the invisible leader, for debugging.
|
||||
|
||||
const DIRECTIONS: Array[Vector2i] = [Vector2i.UP, Vector2i.RIGHT, Vector2i.DOWN, Vector2i.LEFT]
|
||||
|
||||
var isFinished := false
|
||||
var exitPose := {} # The pose we came out as (see start()).
|
||||
|
||||
# The track: points (nodes) at the middle of each tube tile and at each mouth.
|
||||
var _nodePositions := PackedVector2Array()
|
||||
var _nodeLinks: Array[Dictionary] = [] # Per node: {direction (Vector2i): the node that way}.
|
||||
var _mouthOutwards := {} # Mouth node -> the way out of it (Vector2).
|
||||
var _mouthPoses := {} # Mouth node -> the pose we come out as there ({} if there's no room).
|
||||
var _entryMouth := -1
|
||||
|
||||
# The leader: on the track edge from _from to _to, _offset along it...
|
||||
var _from := -1
|
||||
var _to := -1
|
||||
var _offset := 0.0
|
||||
# ...or, while _isOutsideEntry, _outside px out past the entry mouth (on the
|
||||
# way in, or backing out).
|
||||
var _isOutsideEntry := true
|
||||
var _outside := 0.0
|
||||
var _exitMouth := -1 # Once we're leaving, the mouth we're leaving by.
|
||||
var _exitStart := 0.0 # How long the trail was when the leader left by it.
|
||||
|
||||
# Where the leader has been: from the entry mouth to where it is now. Backing up
|
||||
# eats into it.
|
||||
var _trail := PackedVector2Array()
|
||||
var _trailLength := 0.0
|
||||
|
||||
# The pixels, in trail order: row 0 is right behind the leader.
|
||||
var _starts := PackedVector2Array() # Where each pixel was in the sprite we went in as.
|
||||
var _startColors := PackedColorArray()
|
||||
var _ends := PackedVector2Array() # Where it goes in the sprite we come out as.
|
||||
var _endColors := PackedColorArray()
|
||||
var _rows := PackedInt32Array()
|
||||
var _lanes := PackedFloat32Array() # How far left of the trail's middle it flows.
|
||||
var _bodyLength := 0.0 # How far behind the leader the last row is.
|
||||
# The frame we reform as, in the sprite's space. Placed once we know where.
|
||||
var _endFrame := {}
|
||||
|
||||
|
||||
# Squeezes into the tube at `entryCell` heading `entryDirection`.
|
||||
# Poses are {spriteTransform: Transform2D, ...plus whatever the caller wants
|
||||
# back in exitPose}. entryPose is the slime as it is now: backing out reforms us
|
||||
# there. findPose(mouth: Vector2, outward: Vector2) gives the pose for coming
|
||||
# out of a mouth, or {} if there's no room. endFrame: the frame we reform as.
|
||||
func start(sprite: Sprite2D, layer: TileMapLayer, entryCell: Vector2i, entryDirection: Vector2i,
|
||||
width: float, entryPose: Dictionary, findPose: Callable, endFrame: int) -> void:
|
||||
top_level = true
|
||||
global_position = Vector2.ZERO
|
||||
z_index = sprite.z_index + 1
|
||||
|
||||
_build_track(layer, entryCell, entryDirection, entryPose, findPose)
|
||||
var from := PixelStream.get_frame_pixels(sprite, sprite.frame, entryPose.spriteTransform)
|
||||
_endFrame = PixelStream.get_frame_pixels(sprite, endFrame, Transform2D.IDENTITY)
|
||||
if _entryMouth == -1 or from.colors.is_empty() or _endFrame.colors.is_empty():
|
||||
exitPose = entryPose
|
||||
isFinished = true
|
||||
return
|
||||
|
||||
# The leader starts out past the entry mouth, far enough that every pixel
|
||||
# is still in its place in the sprite.
|
||||
_from = _nodeLinks[_entryMouth].values()[0]
|
||||
_to = _entryMouth
|
||||
_offset = _edge_length(_from, _to)
|
||||
_isOutsideEntry = true
|
||||
_outside = GATHER_DISTANCE
|
||||
_trail = PackedVector2Array([_nodePositions[_entryMouth]])
|
||||
|
||||
# The pixels nearest the mouth go in first, a row of laneCount at a time.
|
||||
# If the frame we reform as has more pixels, some are doubled up so none go
|
||||
# missing.
|
||||
var laneCount := maxi(int(width), 1)
|
||||
var order := _sorted_by_distance(from.positions, _nodePositions[_entryMouth], false)
|
||||
var count := maxi(order.size(), _endFrame.colors.size())
|
||||
for k in count:
|
||||
var i: int = order[int(float(k) * order.size() / count)]
|
||||
_starts.append(from.positions[i])
|
||||
_startColors.append(from.colors[i])
|
||||
_rows.append(floori(float(k) / laneCount))
|
||||
_lanes.append((k % laneCount) - (laneCount - 1) / 2.0)
|
||||
_bodyLength = _rows[count - 1] * ROW_SPACING
|
||||
_ends.resize(count)
|
||||
_endColors.resize(count)
|
||||
|
||||
|
||||
# Moves the leader for one physics frame. input: the player's input, with y down.
|
||||
func steer(input: Vector2, delta: float) -> void:
|
||||
if isFinished:
|
||||
return
|
||||
if _exitMouth != -1:
|
||||
_pour_out(delta)
|
||||
return
|
||||
if input == Vector2.ZERO:
|
||||
return
|
||||
input = input.normalized()
|
||||
var distanceLeft := SPEED * delta
|
||||
for i in MAX_NODES_PER_FRAME:
|
||||
if distanceLeft <= EPSILON or isFinished or _exitMouth != -1:
|
||||
break
|
||||
var moved := _step(input, distanceLeft)
|
||||
if moved < 0.0:
|
||||
break # Waiting for the player to press a way that leads somewhere.
|
||||
distanceLeft -= moved
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
queue_redraw()
|
||||
|
||||
|
||||
# ---- Setup ----
|
||||
|
||||
# Maps out the manual tube network from `entryCell`.
|
||||
func _build_track(layer: TileMapLayer, entryCell: Vector2i, entryDirection: Vector2i,
|
||||
entryPose: Dictionary, findPose: Callable) -> void:
|
||||
var cellNodes := {entryCell: _add_node(_cell_point(layer, entryCell, Vector2i.ZERO))}
|
||||
var toVisit: Array[Vector2i] = [entryCell]
|
||||
while not toVisit.is_empty() and cellNodes.size() < MAX_TILES:
|
||||
var cell: Vector2i = toVisit.pop_front()
|
||||
var openings := get_openings(layer, cell)
|
||||
for direction in DIRECTIONS:
|
||||
if openings & side_bit(direction) == 0:
|
||||
continue
|
||||
var nextCell := cell + direction
|
||||
if is_manual(layer, nextCell) and get_openings(layer, nextCell) & side_bit(-direction):
|
||||
if not cellNodes.has(nextCell):
|
||||
cellNodes[nextCell] = _add_node(_cell_point(layer, nextCell, Vector2i.ZERO))
|
||||
toVisit.append(nextCell)
|
||||
_link(cellNodes[cell], cellNodes[nextCell], direction)
|
||||
elif layer.get_cell_source_id(nextCell) == -1:
|
||||
# A mouth into open space.
|
||||
var mouthPosition := _cell_point(layer, cell, direction)
|
||||
var mouth := _add_node(mouthPosition)
|
||||
_link(cellNodes[cell], mouth, direction)
|
||||
_mouthOutwards[mouth] = Vector2(direction)
|
||||
if cell == entryCell and direction == -entryDirection:
|
||||
_entryMouth = mouth
|
||||
_mouthPoses[mouth] = entryPose
|
||||
else:
|
||||
_mouthPoses[mouth] = findPose.call(mouthPosition, Vector2(direction))
|
||||
# Otherwise it opens into something solid: a dead end.
|
||||
|
||||
|
||||
func _add_node(at: Vector2) -> int:
|
||||
_nodePositions.append(at)
|
||||
_nodeLinks.append({})
|
||||
return _nodePositions.size() - 1
|
||||
|
||||
|
||||
func _link(from: int, to: int, direction: Vector2i) -> void:
|
||||
_nodeLinks[from][direction] = to
|
||||
_nodeLinks[to][-direction] = from
|
||||
|
||||
|
||||
# ---- Steering ----
|
||||
|
||||
# Moves the leader up to `distance`, but no further than the next node.
|
||||
# Returns how far it moved, or -1 if it can't move the way the input points.
|
||||
func _step(input: Vector2, distance: float) -> float:
|
||||
if _isOutsideEntry:
|
||||
return _step_outside_entry(input, distance)
|
||||
|
||||
var edgeLength := _edge_length(_from, _to)
|
||||
var direction := _edge_direction(_from, _to)
|
||||
if _offset >= edgeLength - EPSILON:
|
||||
# At a node: take the way on the input points along most (back counts).
|
||||
var way := _best_way_on(_to, input, -2)
|
||||
if way.pull < MIN_PULL:
|
||||
return -1.0
|
||||
if way.node == OUT:
|
||||
_leave_by(_to)
|
||||
else:
|
||||
_from = _to
|
||||
_to = way.node
|
||||
_offset = 0.0
|
||||
return 0.0
|
||||
|
||||
# Partway along an edge: carry on, or turn back. A way on from the node
|
||||
# ahead (or behind) counts too, so pressing towards a turn takes us to it.
|
||||
var aheadPull := maxf(input.dot(direction), _best_way_on(_to, input, _from).pull)
|
||||
var behindPull := maxf(-input.dot(direction), _best_way_on(_from, input, _to).pull)
|
||||
if maxf(aheadPull, behindPull) < MIN_PULL:
|
||||
return -1.0
|
||||
if behindPull > aheadPull:
|
||||
var oldFrom := _from
|
||||
_from = _to
|
||||
_to = oldFrom
|
||||
_offset = edgeLength - _offset
|
||||
direction = -direction
|
||||
var step := minf(distance, edgeLength - _offset)
|
||||
_offset += step
|
||||
_move_trail(direction, step)
|
||||
return step
|
||||
|
||||
|
||||
# Out past the entry mouth: in towards it, or further out to reform where we
|
||||
# went in.
|
||||
func _step_outside_entry(input: Vector2, distance: float) -> float:
|
||||
var pull := input.dot(-_mouthOutwards[_entryMouth])
|
||||
if pull >= MIN_PULL:
|
||||
var step := minf(distance, _outside)
|
||||
_outside -= step
|
||||
if _outside <= EPSILON:
|
||||
_outside = 0.0
|
||||
_isOutsideEntry = false
|
||||
return step
|
||||
if -pull >= MIN_PULL:
|
||||
var step := minf(distance, GATHER_DISTANCE - _outside)
|
||||
_outside += step
|
||||
if _outside >= GATHER_DISTANCE - EPSILON:
|
||||
exitPose = _mouthPoses[_entryMouth]
|
||||
isFinished = true
|
||||
return step
|
||||
return -1.0
|
||||
|
||||
|
||||
# The way on from `node` the input points along most: {pull, node}. `node` is OUT
|
||||
# for leaving the tube there. Never back to `exclude`.
|
||||
func _best_way_on(node: int, input: Vector2, exclude: int) -> Dictionary:
|
||||
var best := {pull = -INF, node = -2}
|
||||
var links: Dictionary = _nodeLinks[node]
|
||||
for way: Vector2i in links:
|
||||
if links[way] == exclude:
|
||||
continue
|
||||
var pull := input.dot(Vector2(way))
|
||||
if pull > best.pull:
|
||||
best = {pull = pull, node = links[way]}
|
||||
if _mouthOutwards.has(node) and _can_leave_by(node):
|
||||
var pull := input.dot(_mouthOutwards[node])
|
||||
if pull > best.pull:
|
||||
best = {pull = pull, node = OUT}
|
||||
return best
|
||||
|
||||
|
||||
func _can_leave_by(mouth: int) -> bool:
|
||||
if mouth == _entryMouth and _trailLength <= EPSILON:
|
||||
return true # Backing out the way we came.
|
||||
return not (_mouthPoses[mouth] as Dictionary).is_empty()
|
||||
|
||||
|
||||
func _leave_by(mouth: int) -> void:
|
||||
if mouth == _entryMouth and _trailLength <= EPSILON:
|
||||
_isOutsideEntry = true
|
||||
_outside = 0.0
|
||||
return
|
||||
|
||||
# On our way out for good. The first rows out go furthest from the mouth, so
|
||||
# pixels don't cross paths much.
|
||||
_exitMouth = mouth
|
||||
_exitStart = _trailLength
|
||||
var spriteTransform: Transform2D = _mouthPoses[mouth].spriteTransform
|
||||
var endPositions := PackedVector2Array()
|
||||
for local: Vector2 in _endFrame.positions:
|
||||
endPositions.append(spriteTransform * local)
|
||||
var order := _sorted_by_distance(endPositions, _nodePositions[mouth], true)
|
||||
var count := _starts.size()
|
||||
for k in count:
|
||||
var j: int = order[int(float(k) * order.size() / count)]
|
||||
_ends[k] = endPositions[j]
|
||||
_endColors[k] = _endFrame.colors[j]
|
||||
|
||||
|
||||
# Once we're leaving, the leader carries on out by itself, pulling the rest of
|
||||
# the pixels after it.
|
||||
func _pour_out(delta: float) -> void:
|
||||
_move_trail(_mouthOutwards[_exitMouth], EXIT_SPEED * delta)
|
||||
if _trailLength - _bodyLength >= _exitStart + GATHER_DISTANCE:
|
||||
exitPose = _mouthPoses[_exitMouth]
|
||||
isFinished = true
|
||||
|
||||
|
||||
# Extends the trail as the leader moves, or eats into it if it's backing up.
|
||||
func _move_trail(direction: Vector2, distance: float) -> void:
|
||||
if _trail.size() >= 2:
|
||||
var last := _trail[_trail.size() - 1] - _trail[_trail.size() - 2]
|
||||
var lastLength := last.length()
|
||||
var alignment := last.dot(direction) / lastLength
|
||||
if alignment < -0.5:
|
||||
# Backing up. A step never passes a node, so it stays within this piece.
|
||||
if distance < lastLength - EPSILON:
|
||||
_trail[_trail.size() - 1] -= last / lastLength * distance
|
||||
_trailLength -= distance
|
||||
else:
|
||||
_trail.remove_at(_trail.size() - 1)
|
||||
_trailLength = maxf(_trailLength - lastLength, 0.0)
|
||||
return
|
||||
if alignment > 0.5:
|
||||
_trail[_trail.size() - 1] += direction * distance
|
||||
_trailLength += distance
|
||||
return
|
||||
_trail.append(_trail[_trail.size() - 1] + direction * distance)
|
||||
_trailLength += distance
|
||||
|
||||
|
||||
func _edge_length(from: int, to: int) -> float:
|
||||
return _nodePositions[from].distance_to(_nodePositions[to])
|
||||
|
||||
|
||||
func _edge_direction(from: int, to: int) -> Vector2:
|
||||
return (_nodePositions[to] - _nodePositions[from]).normalized()
|
||||
|
||||
|
||||
# Indices of `points`, nearest to `target` first (or furthest first).
|
||||
func _sorted_by_distance(points: PackedVector2Array, target: Vector2, furthestFirst: bool) -> Array:
|
||||
var order := range(points.size())
|
||||
order.sort_custom(func(a: int, b: int) -> bool:
|
||||
var aDistance := points[a].distance_squared_to(target)
|
||||
var bDistance := points[b].distance_squared_to(target)
|
||||
if furthestFirst:
|
||||
return aDistance > bDistance
|
||||
return aDistance < bDistance)
|
||||
return order
|
||||
|
||||
|
||||
# ---- Drawing ----
|
||||
|
||||
func _draw() -> void:
|
||||
if _starts.is_empty():
|
||||
return
|
||||
# How far along the trail the leader is (negative while out past the entry).
|
||||
var leaderDistance := _trailLength - (_outside if _isOutsideEntry else 0.0)
|
||||
var trailDistances := PackedFloat32Array([0.0])
|
||||
for i in range(1, _trail.size()):
|
||||
trailDistances.append(trailDistances[i - 1] + _trail[i - 1].distance_to(_trail[i]))
|
||||
|
||||
var entryMouth := _nodePositions[_entryMouth]
|
||||
var entryLeft := (-_mouthOutwards[_entryMouth] as Vector2).orthogonal() # Left of travel going in.
|
||||
for k in _starts.size():
|
||||
var distance := leaderDistance - _rows[k] * ROW_SPACING
|
||||
var color := _startColors[k]
|
||||
var spot: Vector2
|
||||
if distance < 0.0:
|
||||
# Not in yet: drawn from its place in the sprite towards the mouth.
|
||||
var gathered := clampf(-distance / GATHER_DISTANCE, 0.0, 1.0)
|
||||
spot = (entryMouth + entryLeft * _lanes[k]).lerp(_starts[k], gathered)
|
||||
elif _exitMouth != -1 and distance > _exitStart:
|
||||
# Out: gathering into its place in the reformed sprite.
|
||||
var exitMouth := _nodePositions[_exitMouth]
|
||||
var exitLeft := (_mouthOutwards[_exitMouth] as Vector2).orthogonal()
|
||||
var gathered := clampf((distance - _exitStart) / GATHER_DISTANCE, 0.0, 1.0)
|
||||
spot = (exitMouth + exitLeft * _lanes[k]).lerp(_ends[k], gathered)
|
||||
color = color.lerp(_endColors[k], gathered)
|
||||
else:
|
||||
spot = _point_on_trail(distance, _lanes[k], trailDistances)
|
||||
draw_rect(Rect2(spot.floor(), Vector2.ONE), color)
|
||||
|
||||
if SHOW_LEADER:
|
||||
var leader := _point_on_trail(maxf(leaderDistance, 0.0), 0.0, trailDistances)
|
||||
draw_rect(Rect2(leader.floor() - Vector2.ONE, Vector2.ONE * 3), Color.RED, false)
|
||||
|
||||
|
||||
# The point `distance` along the trail, moved `lane` to the left of travel.
|
||||
func _point_on_trail(distance: float, lane: float, trailDistances: PackedFloat32Array) -> Vector2:
|
||||
if _trail.size() < 2:
|
||||
return _trail[0] + (-_mouthOutwards[_entryMouth] as Vector2).orthogonal() * lane
|
||||
var segment := 0
|
||||
while segment < _trail.size() - 2 and distance > trailDistances[segment + 1]:
|
||||
segment += 1
|
||||
var from := _trail[segment]
|
||||
var to := _trail[segment + 1]
|
||||
var direction := (to - from).normalized()
|
||||
return from + direction * (distance - trailDistances[segment]) + direction.orthogonal() * lane
|
||||
|
||||
|
||||
# ---- Tube tiles ----
|
||||
|
||||
# Which sides of the tile at `cell` are open (TUBE_OPEN_... bits in player.gd).
|
||||
# 0 if it isn't a tube.
|
||||
static func get_openings(layer: TileMapLayer, cell: Vector2i) -> int:
|
||||
var data := layer.get_cell_tile_data(cell)
|
||||
if data == null:
|
||||
return 0
|
||||
return data.get_custom_data("tube_openings")
|
||||
|
||||
|
||||
# Whether the tile at `cell` is a manual tube (the "tube_manual" custom data).
|
||||
static func is_manual(layer: TileMapLayer, cell: Vector2i) -> bool:
|
||||
var data := layer.get_cell_tile_data(cell)
|
||||
if data == null or not data.has_custom_data("tube_manual"):
|
||||
return false
|
||||
return data.get_custom_data("tube_manual")
|
||||
|
||||
|
||||
static func side_bit(direction: Vector2i) -> int:
|
||||
match direction:
|
||||
Vector2i.UP: return 1
|
||||
Vector2i.RIGHT: return 2
|
||||
Vector2i.DOWN: return 4
|
||||
Vector2i.LEFT: return 8
|
||||
return 0
|
||||
|
||||
|
||||
# The global middle of `cell`'s side facing `side`, or its centre for Vector2i.ZERO.
|
||||
static func _cell_point(layer: TileMapLayer, cell: Vector2i, side: Vector2i) -> Vector2:
|
||||
var halfTile := Vector2(layer.tile_set.tile_size) / 2.0
|
||||
return layer.to_global(layer.map_to_local(cell) + Vector2(side) * halfTile)
|
||||
1
Effects/tube_steer.gd.uid
Executable file
1
Effects/tube_steer.gd.uid
Executable file
|
|
@ -0,0 +1 @@
|
|||
uid://r40nyur0d0xc
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
position = Vector2(329, 266)
|
||||
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=459516426]
|
||||
tile_map_data = PackedByteArray("AAAAAA4AAAAAAAAAAAABAA4AAAAAAAAAAAACAA4AAAAAAAAAAAADAA4AAAAAAAAAAAAEAA4AAAAAAAAAAAAFAA4AAAAAAAAAAAAGAA4AAAAAAAAAAAAHAA4AAAAAAAAAAAAIAA4AAAAAAAAAAAAJAA4AAAAAAAAAAAAKAA4AAAAAAAAAAAALAA4AAAAAAAAAAAAMAA4AAAAAAAAAAAANAA4AAAAAAAAAAAAOAA4AAAAAAAAAAAAPAA4AAAAAAAAAAAAQAA4AAAAAAAAAAAARAA4AAAAAAAAAAAASAA4AAAAAAAAAAAATAA4AAAAAAAAAAAAKAAsAAAAAAAAAAAAJAAsAAAAAAAAAAAAJAAwAAAAAAAAAAAAJAA0AAAAAAAAAAAAKAA0AAAAAAAAAAAAKAAwAAAAAAAAAAAATAA0AAAAAAAAAAAATAAwAAAAAAAAAAAATAAsAAAAAAAAAAAATAAoAAAAAAAAAAAATAAkAAAAAAAAAAAATAAgAAAAAAAAAAAATAAcAAAAAAAAAAAATAAYAAAAAAAAAAAATAAUAAAAAAAAAAAATAAQAAAAAAAAAAAATAAMAAAAAAAAAAAATAAIAAAAAAAAAAAATAAEAAAAAAAAAAAATAAAAAAAAAAAAAAASAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAADAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAIAAAAAAAAAAA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." unique_id=904032161 instance=ExtResource("3_pause")]
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ Transition="*res://Autoloads/transition.gd"
|
|||
|
||||
window/size/viewport_width=640
|
||||
window/size/viewport_height=480
|
||||
window/size/mode=2
|
||||
window/size/window_width_override=1280
|
||||
window/size/window_height_override=960
|
||||
window/size/mode=2
|
||||
window/stretch/mode="viewport"
|
||||
window/stretch/aspect="expand"
|
||||
window/stretch/scale_mode="integer"
|
||||
|
|
|
|||
Loading…
Reference in a new issue