diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-04-14 21:49:20 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-04-14 21:49:20 +0200 |
commit | f27937e6e9b6a7146dd09fc711d2d293ecf5abbf (patch) | |
tree | e0ddd5e6d356000e4f29af6211a736284a4972ee /Scenes/Components/SceneTransition.gd | |
parent | 96d36cee33d6321834565f0a5d412ef95c5ceffd (diff) |
update
Diffstat (limited to 'Scenes/Components/SceneTransition.gd')
-rw-r--r-- | Scenes/Components/SceneTransition.gd | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/Scenes/Components/SceneTransition.gd b/Scenes/Components/SceneTransition.gd index befeaf4..747d978 100644 --- a/Scenes/Components/SceneTransition.gd +++ b/Scenes/Components/SceneTransition.gd @@ -3,8 +3,9 @@ extends Area2D @export_file() var sceneFilePath @export var targetPlayerPositionNodePath: String +@export_enum("up", "down", "left", "right") var playerFacing: String = "down" -var scene: Node +var scene func _ready(): @@ -30,40 +31,6 @@ func _on_body_entered(body: Node2D): Utilities.fade_bg_music(0.75) tween.connect("finished", func(): Utilities.change_scene_with_player_to_position( - self.scene, player, NodePath(targetPlayerPositionNodePath) + self.scene, player, NodePath(targetPlayerPositionNodePath), playerFacing ) ) - - -#func adjust_camera_to_tilemap(camera: Camera2D, tileMap: TileMap) -> Camera2D: -# var tileMapRect = tileMap.get_used_rect() -# var visibleCorrectionVector = Vector2(tileMap.cell_quadrant_size / 2.0, tileMap.cell_quadrant_size / 2.0) -# var localRect = Rect2( -# tileMap.map_to_local(tileMapRect.position) - visibleCorrectionVector, -# tileMap.map_to_local(tileMapRect.size) - visibleCorrectionVector -# ) -# var viewportRect = get_viewport_rect() -# -# if abs(localRect.end.x) >= abs(viewportRect.end.x): -# camera.set_limit(SIDE_LEFT, localRect.position.x) -# else: -# camera.set_limit(SIDE_LEFT, -10000000) -# -# if abs(localRect.end.y) >= abs(viewportRect.end.y): -# camera.set_limit(SIDE_TOP, localRect.position.y) -# else: -# camera.set_limit(SIDE_TOP, -10000000) -# -# if abs(localRect.end.x) >= abs(viewportRect.end.x): -# camera.set_limit(SIDE_RIGHT, localRect.end.x) -# else: -# camera.set_limit(SIDE_RIGHT, 10000000) -# -# if abs(localRect.end.y) >= abs(viewportRect.end.y): -# camera.set_limit(SIDE_BOTTOM, localRect.end.y) -# else: -# camera.set_limit(SIDE_BOTTOM, 10000000) -# -# print(tileMapRect, localRect, viewportRect) -# -# return camera |