invaders: code cleanup
This commit is contained in:
parent
7c20b14ce5
commit
3895c0cde9
|
@ -78,15 +78,15 @@ function player.new ()
|
||||||
end
|
end
|
||||||
|
|
||||||
function player.move(x)
|
function player.move(x)
|
||||||
local gb = gamedata.player:geometry()
|
local g = gamedata.player:geometry()
|
||||||
|
|
||||||
if x < 0 and gb.x > gamedata.field.x then
|
if x < 0 and g.x > gamedata.field.x then
|
||||||
gb.x = gb.x + x
|
g.x = g.x + x
|
||||||
elseif x > 0 and gb.x < gamedata.field.x + gamedata.field.w - 30 then
|
elseif x > 0 and g.x < gamedata.field.x + gamedata.field.w - 30 then
|
||||||
gb.x = gb.x + x
|
g.x = g.x + x
|
||||||
end
|
end
|
||||||
|
|
||||||
gamedata.player:geometry(gb)
|
gamedata.player:geometry(g)
|
||||||
end
|
end
|
||||||
|
|
||||||
function player.fire()
|
function player.fire()
|
||||||
|
|
Loading…
Reference in New Issue