I get this error:
Code:error: index.lua:6: bad argument #1 to `print' (number expected, got nil)
Printable View
I get this error:
Code:error: index.lua:6: bad argument #1 to `print' (number expected, got nil)
slicer4ever
You get the first error because there is one to many ends. You also have an "end" here:
paintballs[i].x = paintballs[i].x + 10 end
For the second error, it means that in one of the variables there is no value (nil), so you have to check at all the places before this one where the defining occurs. There is where your error is. EDIT: I actually think the problem will be gone after you delete the end that I posted in bold.
Gutya, you use two different vars: texty and textY. You see the difference?
texty = 300
screen:print(textX, textY, "Hello World", white)
Well as you can clearly see both the variables have values.
nope the textY one doesn't have a value, because you dont define it.
See for your self. Change the texty in textY.
Argh, the stupidest little mistakes always catch me out! :cry:
Thanks Altair.
np Gutya
Is there any way that i can make a function where when i press X image1.png will change to image2.png for a given amount of time.
Or something similar.
How can i make an image start at one end of the screen then move across?
First one: Yes thats possible. ((almost) anything is)
Make a timer in that function.
Second one:
You blit the image according to x and y coordinates. You can change those and then it moves.