Skip to content

Instantly share code, notes, and snippets.

@trikyle
trikyle / AirHockey
Last active January 13, 2016 15:14
-- Air Hockey
-- Kyle Wood
supportedOrientations(LANDSCAPE_LEFT)--can only be used in landscape position
function setup()
displayMode(FULLSCREEN_NO_BUTTONS)--starts the game in full screen (for testing purposes)
game=0--initial setup variable to show homescreen
win=0--setting a nul value to bypass the variable test asking who wins
leftscore=0 rightscore=0--setting scores to 0 for start
w={}--setting a table for the wall bodies and goalpoast bodies
w[1]=physics.body(EDGE,vec2(0,0),vec2(0,HEIGHT))--w[1]-w[8] set the wall and goalpost physic bodies