Engine 0.0.4
Game engine in lua
Loading...
Searching...
No Matches
keys.lua
Go to the documentation of this file.
1local key_bindings = {
2 ['return']='enter',
3 up='up',
4 left='left',
5 right='right',
6 down='down',
7 z='red',
8 x='green',
9 c='yellow',
10 v='blue',
11}
12
13local function install(std)
14 if love then
15 love.keypressed = function(key)
16 if key_bindings[key] then
17 std.key.press[key_bindings[key]] = 1
18 end
19 end
20 love.keyreleased = function(key)
21 if key_bindings[key] then
22 std.key.press[key_bindings[key]] = 0
23 end
24 end
25 end
26
27 return {}
28end
29
30local P = {
32}
33
34return P
local std
Definition main.lua:18
local function install(std, lgame, application, ginga)