Jump to content

Proper way to use panda pool?


pettankojin
 Share

Recommended Posts

Hello I was reading the documentation and cheatsheet about object pool but I'm not sure what's the proper way to manage it.

Let's say that I have a game where 2 enemy ships appear every5 seconds. Do I first add 2 objects to the pool? What should I do when there need to be more enemies, like 5?

How do you access the objects individually later?

Also, how do you "deactivate" the objects and return them to the pool.

Sorry if it's an obvious qiestion but I'm not sure how to approach this.

Link to comment
Share on other sites

  • 8 months later...

Hey there,

http://www.pandajs.net/demos/interactivity.html

This tutorial I found helped me out greatly with creating objects.

Using a class to describe them.,

and then you call the class with a loop.

Simply tell the loop how many cycles to perform (or enemies to create).

 

If you need more than just a heads up, I can help you modify the code.

Message me back

 

Link to comment
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...
 Share

  • Recently Browsing   0 members

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