Skip to content

Commit

Permalink
Update car.md
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Nov 2, 2023
1 parent 9d29696 commit 6864955
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/en/tutorials/car.md
Expand Up @@ -299,7 +299,7 @@ function update(self, dt)
...
-- Calculate new velocity based on current acceleration
self.velocity = self.velocity + self.acceleration * dt
...
...
end
```

Expand All @@ -310,11 +310,11 @@ function update(self, dt)
local speed = vmath.length_sqr(self.velocity)

-- Apply drag
self.acceleration = self.acceleration - speed * self.direction * drag
self.acceleration = self.acceleration - speed * self.velocity * drag

-- Stop if we are already slow enough
if speed < 0.5 then self.velocity = vmath.vector3(0) end
...
...
end
```

Expand Down

0 comments on commit 6864955

Please sign in to comment.