put " instead of ' and make it look like this : screenrint . is that all the code? what does the error say exactly?
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 screenrint
put " instead of ' and make it look like this : screenrint . is that all the code? what does the error say exactly?
should beif pad:L()then
screen: print(100,100,LPressed,white)
end
if pad:R()then
screen: print(100,100,RPressed,white)
end
Notice the lower case L and R.if pad:l()then
screen: print(100,100,LPressed,white)
end
if pad:r()then
screen: print(100,100,RPressed,white)
end
you have to remember that lua is always case sensitive. so if you make a variable somthing like Image and later put image, it will think of it as a different variable. or sumtin like that.
http://one.revver.com/watch/170516
http://one.revver.com/watch/167200
Please click the links above to watch my stick figure animations,
and please, if you have the time, click the ads at the end to earn me some money.
yeah, that's right. that too.
i have another question
i want to print a image to the screen if no button is pressed not always just if no button is pressed
kind like this:
if pad:nil() then
screen:blit(............)
nil is if no button is pressed
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks