Reset scene troubles

imGuaimGua Member Posts: 1,089
edited January 2012 in Working with GS (Mac)
I have A LOT of troubles when a reset scene in my game. Some actors don't spawn, some event happening in the wrong time, some event doesn't happening at all. Are those issues caused by timers with flag "Run to Completion"?

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    if there is a strong possibility that a scene will/can be reset, I would suggest:

    a sceneAttribute Index type … leave at 0 for the start of the scene … use to track the flow actions/events in the scene

    in each active actorInstance:
    Rule: when
    Attribute: scene.Flow = 0
    ChangeAttributes for initial positions/parameters of the actor

    if you do not need to further track events:
    create/drag a controlActor off camera that has
    Rule: when
    Attribute: scene.Flow = 0
    --changeAttribute scene.Score To: 0
    --Timer after: 0.05 seconds √Run to Completion
    ---changeAttribute: scene.Flow to 1

    on the resetActor:
    Rule: when touch is pressed
    -changeAttribute: scene.flow To: 0

    also use scene.Score index Attribute to tally score for scene/level
    in your display of the score you would want: game.Score+scene.Score
    when level/scene is complete … just before you changeScene … change game.Score To: game.Score+scene.Score

    when user does a reset … everything is where it should be … game.Score doesn't need to be recalculated.

    MH
  • imGuaimGua Member Posts: 1,089
Sign In or Register to comment.