PDA

View Full Version : getting more than one shot on screen



KunoNoOni
December 2nd, 2005, 07:50
well my shooter is coming along slowly. I'm able to move my character, and it is able to shoot. but I'm only able to get one bullet on the screen at a time. I'm thinking I need to have the bullet function call itself and then use an array to hold all the bullets. I check www.lua.org for the syntax for arrays but can't seem to find anything. Is it possible to use arrays in lua?

cancan
December 2nd, 2005, 11:42
Strange you couldn't find it.

Maybe this link will be helpfull for you.
http://www.lua.org/manual/5.0/

For an array you must define:
table = {}
and after table[1] = 2

KunoNoOni
December 2nd, 2005, 16:38
Hehe, sorry for the confusion. What I meant was, I couldn't find anything about arrays. I've used the LUA manual before :). I'll check it again about the table command. thanks for the info :)

cancan
December 3rd, 2005, 15:13
table is not a command it's just the name I've used for the array example.
You can create an array called prout just by defining prout = {}. :)

KunoNoOni
December 3rd, 2005, 20:28
Oh, now thats interesting. There is also a table command, thats what I thought you were talking about :). OK Thanks for the info!

shiftybill
December 4th, 2005, 11:42
can u pls post the code u use to make this work or at least dumb it down a bit for me so i understand :rolleyes:

i can only get 1 shot on screen as well

i will be adding some enemies to mine very soon too :D

my psprecious
February 19th, 2006, 00:51
here's a good tutorial on arrays

http://www.evilmana.com/tutorials/lua_tutorial_05.php