mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-24 20:24:19 +00:00
33 lines
574 B
Lua
33 lines
574 B
Lua
|
local x, y, scale = 0, 0, 1
|
||
|
|
||
|
local function update(dt)
|
||
|
if love.keyboard.isDown("down") then
|
||
|
y = y - dt * 200
|
||
|
elseif love.keyboard.isDown("up") then
|
||
|
y = y + dt * 200
|
||
|
end
|
||
|
|
||
|
if love.keyboard.isDown("right") then
|
||
|
x = x - dt * 200
|
||
|
elseif love.keyboard.isDown("left") then
|
||
|
x = x + dt * 200
|
||
|
end
|
||
|
|
||
|
if love.keyboard.isDown("-") then
|
||
|
scale = scale - 0.01
|
||
|
elseif love.keyboard.isDown("=") then
|
||
|
scale = scale + 0.01
|
||
|
end
|
||
|
|
||
|
return x, y, scale
|
||
|
end
|
||
|
|
||
|
local function status()
|
||
|
return x, y, scale
|
||
|
end
|
||
|
|
||
|
return {
|
||
|
update = update,
|
||
|
status = status,
|
||
|
}
|