Help with lives

Pineapple_KingPineapple_King Member Posts: 16
edited November -1 in Working with GS (Mac)
Hey all, this is my first post in this particular forum, i just started using gs and i am working my way up designing a pachinko board. (we all got to start from somewhere :P)
My problem is this:
Every time i click the mouse button i spawn an actor (ball).
I want to use a limited number of spawns (ex. 10)
i am representing these limited spawns as lives on the top left corner (10 small hearts lets say)
Every time a spawn/mouse click occurs you are supposed to lose a life.
I want that one by one the hearts disappear, as if the player is losing a life after each click.
Help me create this rule please, I only wish i made myself clear enough...
thanks, keep it up
PK

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    create a game attribute called lives (integer)

    in the button you click that spawns the ball:

    rule when touch is pressed AND (ALL)
    when game.lives > 0

    change attribute game.lives to game.lives-1
    Spawn ball actor

    in the heart actor use replicate and just put in game.lives for the number of replications
  • WeswogWeswog Member Posts: 1,171
    First make an integer attribute then call it lives
    Then put in this on button actor

    Rule:
    Touch is pressed

    attribute lives is >0
    Change attribute lives -1

    Cheers, Weswog
  • Pineapple_KingPineapple_King Member Posts: 16
    Thank you! its working now.
    Cheers
Sign In or Register to comment.