Gamemaker: Making a bullet Spawn at the enemy it was called from

Posted by Strokes on Game Development See other posts from Game Development or by Strokes
Published on 2013-05-19T23:59:05Z Indexed on 2013/11/03 10:17 UTC
Read the original article Hit count: 325

Filed under:

I'm making a gamemaker game with gml. In this game I have multiple enemies (same object) on screen at the same time. I want them to all spawn a bullet at their location. But instead each enemy spawns a bullet at one single enemy. They all shoot but the bullets appear in the wrong location. I want the bullet to spawn at the location of the instance is was called for. How do I do this?

Thank you for reading my question.

Code: obj_carrier is the enemy I want to spawn from. obj_carrier_bullet is the bullet I want to spawn at location of the carrier There are multiple carriers around the stage. In the step event of the carrier following an if statement:

   instance_create(obj_carrier.x, obj_carrier.y, obj_carrier_bullet)

© Game Development or respective owner

Related posts about game-maker