Jump to content

recycling enemies on recycled platforms


phuurup
 Share

Recommended Posts

Hey,

 

I'm trying to practice the phaser framework (and programming in general) by trying to recreate a doodle jump/papi jump game. I have the little ball jumping, enemy on the screen with collision detection and all the platforms being recycled once they die, however I have not been able to recycle (or even place) my enemies on the platforms. Because the platforms are not fixed I can't simply say ( x, y) cause the platform won't always be there. I tried: enemy = game.add.sprite( game.platform.centerX, game.platform.centerY, 'enemy' ); but to no avail. 

 

Am I on the right track? or not even close? Has anyone ever had the same problem and just overcome it in a different way, like creating a platform with an enemy on it by itself, and that entire sprite being its own class that's called on via a timer delay?

 

 

Hopefully this is not too n00by of a question. Tips or directing me to resources are all helpful. Just trying to kill my 'hero', guys(and gals).. 

 

thanks again!

Link to comment
Share on other sites

Oh, ya. Realized what I was talking about were "groups".

 

..as anyone who has seen any of my previous questions can guess; no, no I am not a programming student/professional. Just find this very interesting. :P

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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