help with bullets and foes
Posted: Thu Jan 23, 2014 6:33 am
so im making this for a school project and iv got all my different tabs separated (more organized) so i have a bullet file and a rock file (rock is the meteor that you kill) and they both have tables rock = {} and bullet = {}. so to make the bullet kill the rock I'm using a CheckCollision function. it works fine with one table and one object but i can't make it work with two tables... what am i doing wrong ?
Code: Select all
for i,v in ipairs(bullet) do
xx = v.x
yy = v.y
end
function rock.bullet(dt)
for i,v in ipairs(rock) do
if CheckCollision(v.a, -120, rock.width, rock.height, xx, xx, bullet.width, bullet.height ) then
table.remove(rock, i)
end
end
end
/code]
plz help