Multiplying the Score

eligameseligames Member, PRO Posts: 40

I am trying to make it where when a ball hits the pad then you get one point. I have that but i want to use my spawn button that I have and when a second ball enters then the score is multiplied by 2 and when 3 balls are in its multiplied by 3 etc... The balls are not going to be destroyed either they will be all bouncing around getting 2,3,4 etc... points every time.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited July 2017

    Inside your spawner actor:

    Change Attribute game.multiplier to game.multiplier+1
    Spawn ball

    Inside your pad actor:

    Change Attribute game.score to game.score + game.pointsPerBall * game.multiplier

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

  • eligameseligames Member, PRO Posts: 40

    How do I make the game.pointsPerBall attribute and where do I put it?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You probably want to leave the value of game.multiplier at 0 to begin with but I just gave an example of how to change its default value.

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

  • eligameseligames Member, PRO Posts: 40

    thank you

  • eligameseligames Member, PRO Posts: 40

    I'm still having a problem, it increases my score even when I touch the spawn button how do I get rid of that?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I don't know without seeing how you have your rules set up.

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

Sign In or Register to comment.