Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lstBullets = {}
- function AddBullet(ptype,px,py)
- table.insert(lstBullets, {type=ptype,x=px,y=py})
- end
- AddBullet("player",10,10)
- AddBullet("ennemy",10,10)
- for b1=#lstBullets,1,-1 do
- local bullet1 = lstBullet[b1]
- if bullet1.type == "player" then
- for b2=#lstBullets,1,-1 do
- local bullet2 = lstBullet[b2]
- if bullet2.type == "ennemy" then
- if bullet1 ~= bullet2 and Collide() == true then
- if bullet1.type ~= bullet2.type then
- -- Collision entre 2 types diffΓ©rents
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment