multiple Actors in one region

Heritage

  • Posts: 32
Hi,
I'm trying to make an app that has multiple actors. The object is to get all the actors into one region then goto a new scene. I can get the app to change scenes for one actor into one region. But I need one actor to be moved into the region and wait for the other actors, when all the actors are in the region then the scene needs to move.

Hope I'm being clear enough, and thank you to anyone who can help.

Mr Zefiux

  • Posts: 27
You should make behaviour which count how many actors are in region.
But I've no idea how to do it :/

Heritage

  • Posts: 32
Ok, sounds like a good idea. I'll look into that.

Innes

  • *
  • Posts: 1960
You need to create an attribute to keep track of how many actors are in the region. Each time an actor enters the region, increment the attribute, and when an actor leaves the region, decrement the attribute.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

Innes way is the best (he's a really good programmer)

But for a dirty hack, baring in mind if there's a specific order to the actors going into the region, you could have it work when the last actor enters the region the scene changes.

Innes

  • *
  • Posts: 1960
Just a 'heads-up' in case you have the same problem...

A few months ago, I was working on a game in which The objective was to get multiple objects into a region, but it always double-counted when an object entered. To resolve the problem, I had to divide the current number of objects in the region by 2 to give the correct number. That was an iOS project, and I didn't try it in Flash.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.