one winged angel
July 11th, 2006, 13:32
im learning lua now and i get an eroow saying: loop in gettable
my code look like this
white=Color.new(255,255,255)
upPressed='You are pressing the "UP" button'
downPressed='You are pressing the "DOWN" button'
leftPressed='You are pressing the "LEFT" button'
rightPressed='You are pressing the "Right" button'
crossPressed='You are pressing the "CROSS" button'
trianglePressed='You are pressing the "TRIANGLE" button'
squarePressed='You are pressing the "SQUARE" button'
circlePressed='You are pressing the "CIRCLE" button'
LPressed='You are pressing the "L" button'
RPressed='You are pressing the "R" button'
while true do
screen:clear()
pad=Controls.read()
if pad:up()then
screen: print(100,100,upPressed,white)
end
if pad:left()then
screen: print(100,100,leftPressed,white)
end
if pad:right()then
screen: print(100,100,rightPressed,white)
end
if pad:up()then
screen: print(100,100,upPressed,white)
end
if pad:down()then
screen: print(100,100,downPressed,white)
end
if pad:L()then
screen: print(100,100,LPressed,white)
end
if pad:R()then
screen: print(100,100,RPressed,white)
end
if pad:cross()then
screen: print(100,100,crossPressed,white)
end
if pad:square()then
screen: print(100,100,squarePressed,white)
end
if pad:triangle()then
screen: print(100,100,trianglePressed,white)
end
if pad:circle()then
screen: print(100,100,circlePressed,white)
end
screen.waitVblankStart()
screen.flip()
end
edit: i know that between : and print no pace come but if a hadnt done it it would look like this screen:print
my code look like this
white=Color.new(255,255,255)
upPressed='You are pressing the "UP" button'
downPressed='You are pressing the "DOWN" button'
leftPressed='You are pressing the "LEFT" button'
rightPressed='You are pressing the "Right" button'
crossPressed='You are pressing the "CROSS" button'
trianglePressed='You are pressing the "TRIANGLE" button'
squarePressed='You are pressing the "SQUARE" button'
circlePressed='You are pressing the "CIRCLE" button'
LPressed='You are pressing the "L" button'
RPressed='You are pressing the "R" button'
while true do
screen:clear()
pad=Controls.read()
if pad:up()then
screen: print(100,100,upPressed,white)
end
if pad:left()then
screen: print(100,100,leftPressed,white)
end
if pad:right()then
screen: print(100,100,rightPressed,white)
end
if pad:up()then
screen: print(100,100,upPressed,white)
end
if pad:down()then
screen: print(100,100,downPressed,white)
end
if pad:L()then
screen: print(100,100,LPressed,white)
end
if pad:R()then
screen: print(100,100,RPressed,white)
end
if pad:cross()then
screen: print(100,100,crossPressed,white)
end
if pad:square()then
screen: print(100,100,squarePressed,white)
end
if pad:triangle()then
screen: print(100,100,trianglePressed,white)
end
if pad:circle()then
screen: print(100,100,circlePressed,white)
end
screen.waitVblankStart()
screen.flip()
end
edit: i know that between : and print no pace come but if a hadnt done it it would look like this screen:print