fix: Enforce rooms to be located at (0,0) (#576)

Co-authored-by: Balloonpopper <balloonpopper@git.com>
This commit is contained in:
balloonpopper
2022-04-28 02:42:18 +10:00
committed by GitHub
parent c302b7e75f
commit 72e6517a35
2 changed files with 11 additions and 1 deletions

View File

@@ -178,6 +178,17 @@ func init_room(room: ESCRoom) -> void:
if escoria.main.current_scene == null:
escoria.main.set_scene(room)
# If the room node isn't at (0,0), the walk_stop function will offset the
# player by the same number of pixels when they're at the terrain edge and
# move them when it shouldn't.
if room.position != Vector2(0,0):
escoria.logger.report_errors(
"ESCRoomManager.init_room: Room node not at (0,0)",
[
"The room node's coordinates must be (0,0) instead of %s." % room.position
]
)
_perform_script_events(room)

View File

@@ -185,7 +185,6 @@ tracks/3/keys = {
[sub_resource type="CapsuleShape2D" id=8]
[node name="room2" type="Node2D"]
position = Vector2( -2, 0 )
script = ExtResource( 6 )
global_id = "room2"
esc_script = "res://game/rooms/room02/esc/room02_bridge.esc"