diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2023-12-28 09:41:25 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2023-12-28 09:41:25 +0100 |
commit | 7e579ced0b51f98b2c14a0c868bf428c12d4790b (patch) | |
tree | e9786b6e2e3fe560c648d542a62e5de350f0e3e3 /Levels | |
parent | 2a9cbb1fa0268c3be828c0d872180282704abb61 (diff) |
add puppet animation and set transparencyv2.2.1
Diffstat (limited to 'Levels')
-rw-r--r-- | Levels/Level.gd | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Levels/Level.gd b/Levels/Level.gd index 17975ef..40c75ff 100644 --- a/Levels/Level.gd +++ b/Levels/Level.gd @@ -21,8 +21,11 @@ func _ready(): Network.connect("player_changed", func(id): var remote_player = Network.players[id] + var node_name = "%s_%s_%s" % [remote_player.name, remote_player.character, id] - var puppet = self.get_node(node_name) + var puppet = null + if self.has_node(node_name): + puppet = self.get_node(node_name) if remote_player.current_level != self.idx: if puppet: @@ -34,8 +37,11 @@ func _ready(): puppet.process_mode = PROCESS_MODE_DISABLED self.add_child(puppet) puppet.name = node_name + puppet.modulate = Color(1.0, 1.0, 1.0, 0.5) else: puppet.position = remote_player.position + puppet.get_node("Sprite2D").play(remote_player.animation) + puppet.get_node("Sprite2D").flip_h = remote_player.animation_flip_h ) if has_node("ParallaxBackground"): |