So, I made a collision detection function for when the enemy is hit by the either bullet1 or bullet2 the enemy is removed. However, I want the bullets to be removed too! I tried adding another if then statement and an elseif (for the 2 bullets) but that doesn’t work. I will also need to add sounds and an explosion for the enemy if a bullet collides with it.
How do I modify the following code to add all this?
[lua]local function removeEnemy1( self, event )
if ( event.other == bullet ) then
self:removeSelf()
elseif ( event.other == bullet2 ) then
self:removeSelf()
end
end [import]uid: 54001 topic_id: 12219 reply_id: 312219[/import]