Game Level Events

Just started working with GS and I've been through many videos and such, but I just want to be sure...

It seems to me that everything that makes the game function has to be tied to an actor. Is that correct? I have two scenarios that seem to be game level events, rather than actor, or even scene, specific.

When the game is started you see two large iron doors and after a second, they need to open. I created a game level attribute called DoorsOpen, defaulted to false. I have logic on each door in my initial scene that animates (slides) the door open when the value of DoorsOpen is True.

At the moment, I have another attribute called GameStarted. I added logic to one of the doors that on GameStarted = False will wait one second and then set DoorsOpen to True.

It works, but attaching the delay logic to the door seems a bit odd, to me.

Also, the doors closing and opening is the transition between almost every scene. Do I just add the same actors to each scene or is there a way to create a game level actor?

I thought of creating a GameController actor to handle the game level stuff, but still you have to add it to each scene...

Any technical advice is appreciated...

Thanks.

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Good questions. It's common to have "controller" actors on each scene. If you have multiple levels, you would set up a single level with all of the actors you need including these controllers (e.g. music controller, scene reset controller, doors controller, score controller, etc.). The controllers can be placed in the margin of the scene where they don't appear or they can be placed in the scene but made invisible with Change Attribute self.color.Alpha to 0 (that way you can see them while editing the scene but they disappear as soon as the scene starts). Once you have everything working, you can duplicate the level as many times as needed and make small changes if needed. If your levels/scenes are very different from each other, then you'd need to drag the controller actor(s) onto each scene.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.