Starting a scene on button press

KCDKCD Member Posts: 24
edited July 2012 in Working with GS (Mac)
I am looking to have a scene and all the actors remain in the same place until the scene starts. Is there a way to accomplish this?

Comments

  • lycettebroslycettebros Member, PRO Posts: 1,598
    ?? Not sure I understand. Make a boolean attribute and make all the actors only move when that boolean is true. So when the scene starts the boolean is made true.

    If moveallActor is true
    thisActor moves
  • KCDKCD Member Posts: 24
    Basically, when the scene starts I want all the actors frozen, when a button is pressed all the actors will begin their movement as designed.
  • J_PANJ_PAN Member Posts: 140
    @kevinjcamps, try to create a game boolean atribute (start) to know when the scene starts. then in each actor create a rule saying when attribute start is true change attribute self.movable to true and in the otherwise, change attribute self.movable to false

    then you have other rules in the actor when attribute self.movable is true put accelerate or some kind of movement in the rule

    Cheers

    pan_joshua (http://cssgenius.blogspot.com)
  • KCDKCD Member Posts: 24
    Still having trouble with this.

    I am doing a football type game.

    I have created a boolean attribute named snap and added it like you said but the actors still move.

    I want the scene to start on a key press (spacebar)/button press. Then have all the offensive and defensive players move
  • OskarDeveloperOskarDeveloper Member Posts: 533
    edited July 2012
    A simple way is to make two scenes, name one freeze and one game, drag the game scene so the game starts on that scene. then on that scene make an actor that pauses the game to the freeze scene. Make the bg color of the freeze scene transparent and then make a new actor called "start"

    "Start" rules:
    when key "space" is down
    unpause game

    Drag the start actor to the freeze scene. If every thing works as i think the game will then start on the freeze scene and when you press "space" the game should start. :)
  • 007leokart007leokart Member Posts: 38
    I think that you are trying to make the scene start only after the button is pressed, if yes, try the following:

    Create a boolean attribute called Start, make it false.
    After this, put a rule in all of your actors like this:
    If attribute game.Start - True, put all the actors behavior in it.
    On the otherwise you put absolutely nothing, i think this will work.
  • shebhntshebhnt Member Posts: 74
    @kevinjcamps

    In the game I have been working on I did something pretty similiar to what everyone else has said. I have a "GameStarted" attribute that starts at false until a button is pressed then turned to true. Then when my guy dies it is turned back to false.

    If your guys are still moving even though it is set to false check a few things (I had the same issue)
    1. check to make sure you don't have anything turning the attribute true before you want it to, and that includes the button you are using to start it.
    2. make sure in the otherwise section of the rule that is checking if the game has started to turn the linear motion of your actors to 0 or give it a move behavior set to 0 speed

    Here is a video of my game, is this the kind of thing you were thinking?
  • KCDKCD Member Posts: 24
    Finally got it to work by adding the boolean start attribute true and by creating a rule on each actor attribute-game.play start-false. I added a rule on the scene, actor receives space bar down then added a change attribute-game.play start-false

    Thanks for all the help now on to the next portion
Sign In or Register to comment.