is there a count function in gamesalad?

I want to have a scoring system for my game where every three enemies destroyed = 1 point. I've played around by having two attributes game.zombiesKilled and game.killpoints I had a rule that says:

game.zombiesKilled = 3 change attribute Game.killpoint to game.killpoints + 1

and that obviously wasn't correct. any ideas on how to take this on? thank you.

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2014

    Just have a single attribute, let's call it ZKill.

    Every time an enemy is destroyed change ZKill to ZKill +1

    Display (or otherwise use) your score as floor(ZKill/3)

    Example: https://www.mediafire.com/?9vqql88ivvobnra

  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214

    thank you very much! I will give this a shot!

  • agueisagueis Member Posts: 420

    Perhaps this: game.count =0
    when enemy1 is destroyed change attribute game.count to game cont+1
    when enemy2 is destroyed change attribute game.count to game cont+1
    when enemy3 is destroyed change attribute game.count to game cont+1
    when game.count is=3 change attribute game.count to 0
    spawn score

  • BBEnkBBEnk Member Posts: 1,764

    set your start score at 0.3333333 and floor the score keeper so it only increase when hits 1 or 2 ETC I made a example.

Sign In or Register to comment.