fixed ufo jump + ufo removes it self, if it is on levelnodes:finishline

master
cale 2016-02-21 15:56:43 +01:00
parent ac0c2443b2
commit 09264edf57
1 changed files with 17 additions and 5 deletions

View File

@ -1,3 +1,5 @@
sliding = false
local function get_sign(i)
return i == 0 and 0 or i/math.abs(i)
end
@ -78,11 +80,21 @@ minetest.register_entity("uforun:ufo", {
if self.driver then
local control = self.driver:get_player_control()
local yaw = self.object:getyaw()
if control.up then
self.speed = self.speed+0.2
elseif control.down then
self.speed = self.speed-0.2
if sliding then
if control.up then
self.speed = self.speed+0.2
elseif control.down then
self.speed = self.speed-0.2
end
else
if control.up then
self.speed = self.speed+0.3
elseif control.down then
self.speed = self.speed-0.3
else
self.speed = 0
end
end
if control.left then