Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Maddy on July 11, 2019, 01:15:51 PM

Title: One Game Object, many FSMs or each FSM on each game object?
Post by: Maddy on July 11, 2019, 01:15:51 PM
On my menu page, I'll have lots of level thumbnails.

Is it best to have one Game Manager with hundreds of "clicks" to all the different levels?

or...

Each click (FSM) on each thumbnail? Use Owner.

Mobile 2D game.

Thanks in advance.
Title: Re: One Game Object, many FSMs or each FSM on each game object?
Post by: jeanfabre on July 12, 2019, 03:32:24 AM
Hi,

 you probably will have both. I usually do so.

 each thumbnail can have an fsm that will react on click and fire a global event, passing along an ID for that thumbnail.

then, you have a manager fsm that catches this global event, check out the ID and act accordingly, loading a level, or whatever is supposed to happen.

This way, you compartiment logic and responsability, which make it more flexible, as well as making your system easy to debug and control.

Bye,

 Jean
Title: Re: One Game Object, many FSMs or each FSM on each game object?
Post by: djaydino on July 13, 2019, 08:58:29 PM
Hi.
For level select i made these 2 actions a while back and use them most of the time "UiButtonFromArrayIndex" or "UiButtonArrayIndex" (both found on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))

The index result i use then on a different array where i get the scene name.
Then i do 'load scene' or 'load scene Asynch' (scene By Name)