lui you are the best that helped me so much=-)(cmd thing)
new question is there a duplication feature like laser:duplicate(laser+i)
i'll do a little searching
Printable View
lui you are the best that helped me so much=-)(cmd thing)
new question is there a duplication feature like laser:duplicate(laser+i)
i'll do a little searching
What code would I use to make something fall down the screen?
@slicer4ever. You could make a function with x and y variables and call the function with the coordinates you want, maybe something like...
Where "image" is the image you want to duplicateCode:function duplicate()
screen:blit(x, y, image)
screen.flip()
end
would this reset the thing if used a second time?
No, you can call the function over and over again. The purpose is to call the same things over and over again without having to keep on typing it out. You can write the function in or outside of your main loop
k i'll try it and thanks=-)
Depending on the nature of the duplication you might want to put differnt variables, but thats up to you.
hmm...how do you call the function i tried:
if pad:cross() then duplicate()
end
but it doesn't seem to wanna work
edit: nvm i forgot: if pad:cross() then duplicate()
You have to do it like this.
So when you want that to happen just type duplicate() in the codeCode:function duplicate()
if pad:cross() then
screen:blit(x,y, image)
Click me for a tut on functions
k thanks=-)
Earlier I asked how I would read from a .txt file in lua and display some of it on screen...
someone said the function would be io.read or something like that
could someone explain more how to use this? Like if I wanted to write a score to a text file, would it be io.write?
and what would I have to put after that for it to write a number to a text file