diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 14:20:18 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 14:20:18 -0400 |
| commit | 2bb2ff871fa1761478442bec5f6a32c9428360a1 (patch) | |
| tree | 9b73df7a0c50c02353ae7bca7c2cd54788ef0077 /examples/game/player.tm | |
| parent | 59845e610f2c90474f34079d27b5f1e07071ded4 (diff) | |
Change method calls to use `foo.baz()` instead of `foo:baz()`
Diffstat (limited to 'examples/game/player.tm')
| -rw-r--r-- | examples/game/player.tm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/game/player.tm b/examples/game/player.tm index f73dcf6a..7f14f51e 100644 --- a/examples/game/player.tm +++ b/examples/game/player.tm @@ -16,11 +16,11 @@ struct Player(pos,prev_pos:Vector2): target_y := inline C:Num32 { (Num32_t)((IsKeyDown(KEY_W) ? -1 : 0) + (IsKeyDown(KEY_S) ? 1 : 0)) } - target_vel := Vector2(target_x, target_y):norm() * Player.WALK_SPEED + target_vel := Vector2(target_x, target_y).norm() * Player.WALK_SPEED vel := (p.pos - p.prev_pos)/World.DT vel *= Player.FRICTION - vel = vel:mix(target_vel, Player.ACCEL) + vel = vel.mix(target_vel, Player.ACCEL) p.prev_pos, p.pos = p.pos, p.pos + World.DT*vel |
