playMaker

Author Topic: Wave Spawning  (Read 1846 times)

TKnebel

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Wave Spawning
« on: March 20, 2012, 03:30:16 PM »
I'm new to playmaker and I'm trying to implement a wave spawning system.
I have poolmanager 2 as well.

I have a spawn pool setup with 50 enemies I would like to spawn. (all the same prefab)

I have a spawn button that I press, and it spawns one of the enemies using the poolmanager 2 custom action kit's "PmtSpawn" action, and then hides the button until the enemy is dead.

This works fine and exactly how I'd like it to, however, I would like to spawn the entire wave of 50 enemies with a set interval between each (say half a second). What is the most efficient way of doing this?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3616
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Wave Spawning
« Reply #1 on: March 20, 2012, 05:39:37 PM »
Check out PlayMakerSamples/TestLab/Spawning for some ideas.

NOTE: Import the samples into a new project so you don't overwrite any assets in your project.

SpawnGrid spawns prefabs in a grid formation with a delay.

Other samples use empty game objects as spawn points.

If you have spawn point objects in the scene, consider parenting them to an empty game object and search for the Get Next Child action on the forums. This action lets you easily loop through all the children of a GameObject. This would also allow you to organize each wave under a separate named parent (Wave1, Wave2, BonusWave etc.).

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14228
  • Official Playmaker Support
    • View Profile
Re: Wave Spawning
« Reply #2 on: March 20, 2012, 10:13:44 PM »
Hi,

 Some custom actions to work with pool manager 2 are now available:

https://hutonggames.fogbugz.com/default.asp?W839

You can then combine what you have learn form the playmaker sample and use pm2 to managed the pools.

Bye,

 Jean