playMaker

Author Topic: One Game Object, many FSMs or each FSM on each game object?  (Read 926 times)

Maddy

  • Playmaker Newbie
  • *
  • Posts: 34
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.
I'm an artist with poor memory and brain fog trying to make a game. Please wish me luck! :-D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: One Game Object, many FSMs or each FSM on each game object?
« Reply #1 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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: One Game Object, many FSMs or each FSM on each game object?
« Reply #2 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)

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)