AtkinsSJ

Lua tables

Dec 8th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.30 KB | None | 0 0
  1. santafire = {} -- Create a table to hold all the bullets
  2.  
  3. -- Then, when you want to fire a bullet, do:
  4. table.insert(santafire, sShot(player.x+25, player.y+25))
  5.  
  6. -- and to remove it do:
  7. table.remove(santafire, reference to the bullet)
  8. -- probably the bullet itself would call this code, and pass itself
Advertisement
Add Comment
Please, Sign In to add comment