summaryrefslogtreecommitdiff
path: root/Levels/Level.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Levels/Level.gd')
-rw-r--r--Levels/Level.gd11
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):