diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2023-12-25 12:03:15 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2023-12-25 12:03:15 +0100 |
commit | d74263a17e98159b2e3176a5f8e1ff361909c210 (patch) | |
tree | 868520cc28b32f60bfcde231c4b61878e7c171e4 /Levels/Level.gd | |
parent | afb1ca10cca0982d37fe76b226b606ca7aa5335c (diff) |
level backgrounds
Diffstat (limited to 'Levels/Level.gd')
-rw-r--r-- | Levels/Level.gd | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Levels/Level.gd b/Levels/Level.gd index 0706b0b..910feb8 100644 --- a/Levels/Level.gd +++ b/Levels/Level.gd @@ -1,6 +1,8 @@ extends Node2D +var character: CharacterBody2D + var idx = 0 var timer = 0 @@ -14,8 +16,15 @@ func _ready(): self.set_hud() get_tree().get_root().size_changed.connect(Callable(self, 'resize_hud')) - var character = load("res://Characters/" + Network.player.character + ".tscn").instantiate() + character = load("res://Characters/" + Network.player.character + ".tscn").instantiate() self.set_player(character) + + if has_node("ParallaxBackground"): + $ParallaxBackground/ParallaxLayer.motion_mirroring.x = ( + $ParallaxBackground/ParallaxLayer/Sprite2D.get_rect().size + * + $ParallaxBackground/ParallaxLayer/Sprite2D.scale + ).x func _process(delta): |