Sign in to follow this  
phuurup

recycling enemies on recycled platforms

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.