diff options
author | nokoe <nokoe@mailbox.org> | 2024-06-23 22:22:10 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2024-06-23 22:22:44 +0200 |
commit | a81020eb81a0fa44f6641f47bd1eeda786cc8f71 (patch) | |
tree | b9e49d33d3025c9ab43a85866b2c614268a4cf65 /client/player/controllable_player.gd | |
parent | 485ca41108d22be82755151c1a3e596789eafbeb (diff) | |
download | hurrycurry-a81020eb81a0fa44f6641f47bd1eeda786cc8f71.tar hurrycurry-a81020eb81a0fa44f6641f47bd1eeda786cc8f71.tar.bz2 hurrycurry-a81020eb81a0fa44f6641f47bd1eeda786cc8f71.tar.zst |
fix scripts
Diffstat (limited to 'client/player/controllable_player.gd')
-rw-r--r-- | client/player/controllable_player.gd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd index 4c157349..bb9c75e8 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -32,7 +32,7 @@ func _ready(): add_child(timer) timer.start() timer.connect("timeout", func(): - Multiplayer.send_position(Vector2(position.x, position.z), rotation.y) + Multiplayer.send_position(position_, rotation_) ) func _process(delta): @@ -53,7 +53,7 @@ func _process(delta): func update(dt: float, input: Vector2): var direction = input.limit_length(1.); - rotation.y = atan2(self.facing.x, self.facing.y); + rotation_ = atan2(self.facing.x, self.facing.y); if direction.length() > 0.1: self.facing = direction + (self.facing - direction) * exp(-dt * 10.); self.velocity_ += direction * dt * PLAYER_SPEED; @@ -76,7 +76,7 @@ func collide(dt: float): self.position_ += (PLAYER_SIZE - d) * grad; self.velocity_ -= grad * grad.dot(self.velocity_) - + for player: Player in game.players.values(): var diff = self.position_ - player.position_ var d = diff.length() |