Skip to content
Snippets Groups Projects
Commit 8114c3db authored by Auke Kok's avatar Auke Kok Committed by paramat
Browse files

Limit entity speed to 250m/s.

Let's just call it "terminal" velocity.
parent e6cef576
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,12 @@ local function calc_velocity(pos1, pos2, old_vel, power)
-- Add old velocity
vel = vector.add(vel, old_vel)
-- Limit to terminal velocity
dist = vector.length(vel)
if dist > 250 then
vel = vector.divide(vel, dist / 250)
end
return vel
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment