Jump to content

Chase bullet


YuShaN
 Share

Recommended Posts

Yeah it's normal. At the end of your update() function you call launchEnemy(), which will populate the enemy var, and them launchEnemy2(), which will populate the same enemy var (and thus override previous assignment). And at next update, first thing you do is fire bullets at the enemy var. 

 

So enemy var will always be populated last by the launchEnemy2() method, that is, with enemy2 enemies.

Link to comment
Share on other sites

Yeah it's normal. At the end of your update() function you call launchEnemy(), which will populate the enemy var, and them launchEnemy2(), which will populate the same enemy var (and thus override previous assignment). And at next update, first thing you do is fire bullets at the enemy var. 

 

So enemy var will always be populated last by the launchEnemy2() method, that is, with enemy2 enemies.

I understand but how to fix it :D

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...