Increase speed with score

I've tried to increase the speed of my actor every 10 points for example. However the speed increases after 10 points but only for a short time and goes back to the starting speed once the score reaches 11. What I've done:

First I created a real attribute for my actor and a change attribute: change game.speed -> 150
Then I created an integer to store my score. Then I created an integer with the value 10 and said and created a rule that said, if game.Score is grater than or equal to the integer (the value 10) and a change attribute that said: change game.Speed to game.Speed+200.

This works if I example want to spawn an actor after 10 points but the speed only increases for a short time and than goes back to the starting value.

Comments

  • natedawgghnatedawggh Member, PRO Posts: 34

    Can you put up a screen shot of your code?

  • quantumsheepquantumsheep Member Posts: 8,188
    edited March 2014

    @natedawggh said:
    Can you put up a screen shot of your code?

    That would help!

    I'd try something like:

    If score is greater or equal to 10
    AND
    If score is less than 20

    Change speed to 350

    Then next rule:

    If score is greater or equal to 20
    AND
    if score is less than 29

    Change speed to 500

    Or whatever.

    Another way would be to assign the speed change to a variable via a table.

    So you could have a table with speed change values in it (e.g. 350, 500) and where you put 'Change speed to 500' you'd instead have 'Change speed to tablecellvalue(table.Speed,row1,row1)

    Just some thoughts :)

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • Boorje75Boorje75 Member Posts: 13

    the score increases every time two actors collides, maybe it has to do something with that? that it requires me to make a change there?

Sign In or Register to comment.