Dynamically assign script values for items and inputs
This commit is contained in:
@@ -1,51 +1,41 @@
|
||||
module('platform')
|
||||
module('input')
|
||||
module('scene')
|
||||
module('item')
|
||||
|
||||
-- Default Input bindings.
|
||||
if PLATFORM == "psp" then
|
||||
inputBind("up", "up")
|
||||
inputBind("down", "down")
|
||||
inputBind("left", "left")
|
||||
inputBind("right", "right")
|
||||
inputBind("circle", "cancel")
|
||||
inputBind("cross", "accept")
|
||||
inputBind("select", "ragequit")
|
||||
inputBind("lstick_up", "up")
|
||||
inputBind("lstick_down", "down")
|
||||
inputBind("lstick_left", "left")
|
||||
inputBind("lstick_right", "right")
|
||||
inputBind("up", INPUT_ACTION_UP)
|
||||
inputBind("down", INPUT_ACTION_DOWN)
|
||||
inputBind("left", INPUT_ACTION_LEFT)
|
||||
inputBind("right", INPUT_ACTION_RIGHT)
|
||||
inputBind("circle", INPUT_ACTION_CANCEL)
|
||||
inputBind("cross", INPUT_ACTION_ACCEPT)
|
||||
inputBind("select", INPUT_ACTION_RAGEQUIT)
|
||||
inputBind("lstick_up", INPUT_ACTION_UP)
|
||||
inputBind("lstick_down", INPUT_ACTION_DOWN)
|
||||
inputBind("lstick_left", INPUT_ACTION_LEFT)
|
||||
inputBind("lstick_right", INPUT_ACTION_RIGHT)
|
||||
else
|
||||
if INPUT_KEYBOARD then
|
||||
inputBind("w", "up")
|
||||
inputBind("s", "down")
|
||||
inputBind("a", "left")
|
||||
inputBind("d", "right")
|
||||
inputBind("w", INPUT_ACTION_UP)
|
||||
inputBind("s", INPUT_ACTION_DOWN)
|
||||
inputBind("a", INPUT_ACTION_LEFT)
|
||||
inputBind("d", INPUT_ACTION_RIGHT)
|
||||
|
||||
inputBind("left", "left")
|
||||
inputBind("right", "right")
|
||||
inputBind("up", "up")
|
||||
inputBind("down", "down")
|
||||
inputBind("left", INPUT_ACTION_LEFT)
|
||||
inputBind("right", INPUT_ACTION_RIGHT)
|
||||
inputBind("up", INPUT_ACTION_UP)
|
||||
inputBind("down", INPUT_ACTION_DOWN)
|
||||
|
||||
inputBind("enter", "accept")
|
||||
inputBind("e", "accept" )
|
||||
inputBind("enter", INPUT_ACTION_ACCEPT)
|
||||
inputBind("e", INPUT_ACTION_ACCEPT)
|
||||
|
||||
inputBind("escape", INPUT_ACTION_CANCEL)
|
||||
inputBind("q", INPUT_ACTION_CANCEL)
|
||||
|
||||
inputBind("escape", "cancel")
|
||||
inputBind("q", "cancel")
|
||||
|
||||
inputBind("z", "ragequit")
|
||||
inputBind("z", INPUT_ACTION_RAGEQUIT)
|
||||
end
|
||||
end
|
||||
|
||||
print("Backpack:", BACKPACK)
|
||||
print('Has Potion?', inventoryItemExists(BACKPACK, 1))
|
||||
inventoryAdd(BACKPACK, 1, 3)
|
||||
print('Has Potion?', inventoryItemExists(BACKPACK, 1))
|
||||
inventoryRemove(BACKPACK, 1)
|
||||
print('Has Potion?', inventoryItemExists(BACKPACK, 1))
|
||||
print('Potion Count:', inventoryGetCount(BACKPACK, 1))
|
||||
print('Is Backpack Full?', inventoryIsFull(BACKPACK))
|
||||
|
||||
-- sceneSet('map')
|
||||
-- mapLoad('map/testmap/testmap.dmf')
|
||||
Reference in New Issue
Block a user