Trigger "Volume" for top down 2D game?

Hi All,

I’m working on a top down 2D RPG (think like original legend of zelda).

I need to set up some “trigger volumes” to be able to tell the game to transition from one map to the next.

Does anyone have any advice on how to do this?

Maybe create an alphad out rectangular shape and place at a screen exit with an event listener listening for the player to enter? What type of event listener would I use?

Thanks in advance for any advice you can offer :slight_smile: [import]uid: 105707 topic_id: 24476 reply_id: 324476[/import]

Hey there,

You could use a sensor if the player is a physical object.

Else, you could use a Runtime listener that checks for the player’s coords and then changes scenes if they’re in a certain place.

Make sense?

Peach :slight_smile: [import]uid: 52491 topic_id: 24476 reply_id: 99178[/import]

Hi Peach,

The runtime listener checking coordinates makes sense. Even though that sounds straight forward, I’ll be looking for a code sample if anyone has a tip on something to look at! :slight_smile:

As far as the use of a sensor with the physics engine you’re meaning like this, correct?:
http://developer.anscamobile.com/reference/index/bodyissensor

So body.isSensor will let the player’s body move through the “trigger”. What event listener would I use to actually “fire” the trigger? I’m guessing an event listener that is looking for the “collision” of the two bodies I’m looking for?

Hmm… I’m working up some logic that I think I would use but am realizing that I’m not quite on point with this yet.

Is there a good tutorial on working with event listeners?

Thanks for the help :slight_smile: [import]uid: 105707 topic_id: 24476 reply_id: 99420[/import]

Peach, I just came accross your sensors tutorial… this looks pretty helpful regarding the physics end of the spctrum. Thanks :slight_smile:

http://techority.com/2011/08/31/lets-talk-about-sensors/ [import]uid: 105707 topic_id: 24476 reply_id: 99422[/import]

Hey EHO,

I hope that tutorial helps you get this going.

If you have questions about the logic after you have read it please post here again and I’ll help you get it figured out :slight_smile: [import]uid: 52491 topic_id: 24476 reply_id: 99445[/import]