o_topplayer.x=o_bottomplayer.x o_topplayer.y=o_bottomplayer.yi have the same code for the enemy tanks as well. but if i have two of the same enemy tanks then when i put in this code for them, both of the enemy tanks' turrets are on one tank. do i have to make a separate tank for every enemy i want to put into the room?
more than one instance in the same room
#1
Posted 03 March 2012 - 06:12 PM
#2
Posted 03 March 2012 - 06:50 PM
#3
Posted 03 March 2012 - 08:47 PM
but when i do this it does the same thing and draws both of the turrets ontop of one tankWith the current way you have the code set up, you would have to have different objects for each enemy. This can be fixed by trying to combine the two objects into one object instead of placing two objects on top of one another. For example, in the step event you could use draw_sprite_ext to draw the turret on top of the tank and rotate it towards the mouse.
#4
Posted 03 March 2012 - 09:26 PM
theTurret = instance_create(x,y,o_topplayer) // this is in the o_bottomplayer's create code
and in the o_bottomplayer's endstep
theTurret.x = x
theTurret.x = y
Keep in mind, when the tank explodes, you need to do
with (theTurret)
{
instance_destroy
}
Edited by greep, 03 March 2012 - 09:27 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











