Attributes Question

luke2125luke2125 Member, PRO Posts: 225
edited April 2012 in Working with GS (Mac)
Hi,

Currently working on a game and I'm stuck on the following, hope, someone can help....I have a Rule as follows:

When All Conditions are Valid

Attribute gamekidscore >=5

Next Scene

Works fine, now, the problem comes in when I set the following:

When All Conditions are Valid

Attribute gamekidscore < 5

Go to Scene GameOver

Since I set kidscore attribute as 0, everytime I play the Scene it goes to Game Over Scene. How can I fix this....Thanks and God Bless....

Sincerely,

Sunday

Best Answer

Answers

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    edited April 2012
    add a second condition

    When all conditions are valid
    Attribute Game.kidscore < 5
    and Attribute Game.kidscore > 0
  • luke2125luke2125 Member, PRO Posts: 225
    Hi there,

    Thanks for the quick response and help, really appreciated it....I've tried the second condition, and it still goes to the game over screen, right from the start. Any other suggestions? Thanks and God Bless....

    Sincerely,

    Sunday
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Can you explain how scoring works in your game? I understand it starts at 0, but do players get 1 point for an action, or 10, or does it really start at 50 and count down, etc.?

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

  • luke2125luke2125 Member, PRO Posts: 225
    Hi there,

    Ok, I have set-up an attribute called kidscore ( interger ) = 0. Now, I have an Actor which I called Kidbubble, and on this actor I have the below set-up:

    Rotate : Direction * Clockwise Speed = 90

    Rule: When All conditions are valid: Actor receives event : overlaps or collides with Actor Type: starkid

    Change Attribute : game.kidscore To game.kidscore+1
    Change Attribute: game.totalkidssaved To game.totalkidssaved +1

    Destroy this Actor

    Rule: When All conditions are valid:
    Attribute : gamekidscore >= 5
    Change Scene: Next Scene

    The totalkidssaved is an overall score of the kidscore, I'm using the kidscore to pass to next level. In other words, on next level, the kidscore > =10, then the player passes to next scene ( next level ). Then, 10 gets added to totalkidssaved. I hope it's not confusing.....Thanks again and God Bless...

    Sincerely,

    Sunday



  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    So based on what you said, your earlier rule:

    When All Conditions are Valid
    Attribute gamekidscore < 5
    Go to Scene GameOver

    Doesn't make sense. It seems like you need another condition, such as when scene.time > 30 or something along those lines. When do you want the game to be over?

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

  • luke2125luke2125 Member, PRO Posts: 225
    Hi there,

    Thanks for the insight and help, I added another condition for the game ending, to the Alienship which is being spawned by a spawn actor:

    Rule: All conditions are valid:

    Attribute - self.Position.X < = 0
    Attribute - game.kidscore > = 0
    Attribute - game.kidscore < 5

    Change Scene
    Goto Scene gameover

    So far it's working........Thanks again for the help, really appreciated it....God Bless...

    Sincerely,

    Sunday
Sign In or Register to comment.