Engine 0.0.4
Game engine in lua
Loading...
Searching...
No Matches
keys.lua
Go to the documentation of this file.
1local function update(dt, std)
2 std.key.press.up = love.wiimote.isDown(0, 'up') and 1 or 0
3 std.key.press.down = love.wiimote.isDown(0, 'down') and 1 or 0
4 std.key.press.left = love.wiimote.isDown(0, 'left') and 1 or 0
5 std.key.press.right = love.wiimote.isDown(0, 'right') and 1 or 0
6 std.key.press.red = love.wiimote.isDown(0, 'a') and 1 or 0
7 std.key.press.green = love.wiimote.isDown(0, 'b') and 1 or 0
8 std.key.press.yellow = love.wiimote.isDown(0, '1') and 1 or 0
9 std.key.press.blue = love.wiimote.isDown(0, '2') and 1 or 0
10 std.key.press.enter = love.wiimote.isDown(0, '+') and 1 or 0
11end
12
13local function install(std)
14 if love then
15 if love.update then
16 local old_update = love.update
17 love.update = function(dt)
18 old_update(dt)
19 update(dt, std)
20 end
21 else
22 love.update = function(dt)
23 update(dt, std)
24 end
25 end
26 end
27
28 return {}
29end
30
31local P = {
33}
34
35return P
local std
Definition main.lua:18
local function install(std, lgame, application, ginga)
local function update(dt, std)