[NEW] Controller.lua - Gestiona tot lo relatiu al teclat i gamepad
[NEW] opcions_input.lua - Pantalla de definició de tecles per a teclat i pad - Modificat el abad per a que use controller
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
arcade_config = require("arcade_config")
|
||||
coords = require "coords"
|
||||
require "helpers"
|
||||
require "controller"
|
||||
require "flow"
|
||||
|
||||
require "map"
|
||||
@@ -14,6 +15,7 @@ require "scenes"
|
||||
require "title"
|
||||
require "game"
|
||||
require "opcions"
|
||||
require "opcions_input"
|
||||
|
||||
--require "fps"
|
||||
--require "title"
|
||||
@@ -30,26 +32,6 @@ coords.set_config({
|
||||
rooms_per_floor = mapa_rooms_per_piso,
|
||||
})
|
||||
|
||||
function keys_init()
|
||||
-- Configuració dels input
|
||||
keyUp = tonumber(config.key("keyup")) or key.UP
|
||||
keyDown = tonumber(config.key("keydown")) or key.DOWN
|
||||
keyLeft = tonumber(config.key("keyleft")) or key.LEFT
|
||||
keyRight = tonumber(config.key("keyright")) or key.RIGHT
|
||||
keyJump = tonumber(config.key("keyjump")) or key.UP
|
||||
keyShoot = tonumber(config.key("keyshoot")) or key.SPACE
|
||||
|
||||
btnUp = tonumber(config.key("btnup")) or pad.UP
|
||||
btnDown = tonumber(config.key("btndown")) or pad.DOWN
|
||||
btnLeft = tonumber(config.key("btnleft")) or pad.LEFT
|
||||
btnRight = tonumber(config.key("btnright")) or pad.RIGHT
|
||||
btnJump = tonumber(config.key("btnjump")) or pad.B
|
||||
btnShoot = tonumber(config.key("btnshoot")) or pad.A
|
||||
btnCycle1 = tonumber(config.key("btncycle1")) or pad.RIGHTSHOULDER
|
||||
btnCycle2 = tonumber(config.key("btncycle2")) or pad.LEFTSHOULDER
|
||||
btnPause = tonumber(config.key("btnpause")) or pad.START
|
||||
end
|
||||
|
||||
function images_init()
|
||||
tiles=surf.load("tiles.gif")
|
||||
surf.source(tiles)
|
||||
@@ -100,12 +82,12 @@ function mini.init()
|
||||
mapa_init()
|
||||
fade.init()
|
||||
audio_init()
|
||||
keys_init()
|
||||
controller:init()
|
||||
logo_config(font_sf)
|
||||
surf.target(0)
|
||||
surf.cls(16)
|
||||
|
||||
flow:executar("logo")
|
||||
flow:executar("title")
|
||||
end
|
||||
|
||||
function mini.update()
|
||||
|
||||
Reference in New Issue
Block a user