Skip to content

Instantly share code, notes, and snippets.

@bucketh3ad
bucketh3ad / InventoryRefactorB&A
Last active December 17, 2015 06:39
A small part of the inventory refactor for journey to hawkthorne -bucketh3ad
BEFORE:
function Inventory:keypressed( button )
if self:isOpen() then
if button == 'SELECT' then
self:close()
end
if button == 'RIGHT' then
self:right()
end
if button == 'LEFT' then
@bucketh3ad
bucketh3ad / gist:4562481
Last active December 11, 2015 06:58
Possible Konami Code Fixes
Possibility 1:
self.konami = { 'UP', 'UP', 'DOWN', 'DOWN', 'LEFT', 'RIGHT', 'LEFT', 'RIGHT', 'JUMP', 'ATTACK' }
TO
self.konami = { 'UP', 'UP', 'DOWN', 'DOWN', 'LEFT', 'RIGHT', 'LEFT', 'RIGHT', 'SELECT', 'ATTACK' }
Possibilty 2:
if self.konami[self.konami_idx + 1] == button then
self.konami_idx = self.konami_idx + 1
@bucketh3ad
bucketh3ad / gameover.lua
Created November 15, 2012 08:18
Gameover to select
...
-- From splash to select
function state:keypressed( button )
Gamestate.switch("select")
end
...