Increase speed of actors with score/round

Hi all,
In my game, I want the speed of an actor to increase every time the player scores 10 points.
How do I go about updating the speed of the actor only when the player scores 10, 20, 30, etc? I don't want there to be a limit, it should be able to go on forever (or until the player loses).

The actor has a Speed atribute, and the game has a Speed Modifier attribute.
I have a rule that changes the velocity of the actor's speed to self.Speed * game.Speed Modifier

Question 1) How do I allow for the Speed Modifier to increase every 10 points, with no end in sight?

Question 2) How do I get the actor to update it's velocity? It doesn't seem to be reacting to the changes in Speed Modifier. However, if I spawn a new actor after the Speed Modifier has changed, I notice the velocity difference. I just can't get the current actors to update their velocity after they spawn.

Thanks!

Comments

  • AdrenalineAdrenaline Member Posts: 523
    I'm considering having the actor spawn a copy of itself whenever the player scores 10 points, so that the new speed is in effect. This can't be the best way to do this, though
  • AdrenalineAdrenaline Member Posts: 523
    I'm exploring tables as an option here. I haven't used them before, so any help would be GREATLY appreciated
  • AdrenalineAdrenaline Member Posts: 523
    I'm beginning to think this can't be done. I have only been able to adjust the speed of each actor upon spawn, not mid-life.

    If anyone knows anything about this, please chime in.

    Thanks!
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    1) How do I allow for the Speed Modifier to increase every 10 points . . .
    Store the current score in an attribute - let's call it 'LastRecordedScore'.

    Then have a rule that says when the current score = ['LastRecordedScore'+10] then change 'LastRecordedScore' to the current score and increase the value of the speed modifier - eg: change speed modifier to speed modifier + 1
  • AdrenalineAdrenaline Member Posts: 523
    Thanks Socks!
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    Question 2) How do I get the actor to update it's velocity? It doesn't seem to be reacting to the changes in Speed Modifier. However, if I spawn a new actor after the Speed Modifier has changed, I notice the velocity difference. I just can't get the current actors to update their velocity after they spawn.
    Maybe upload your project to mediafire (or wherever) and post it here - it will make it much much easier for people to work out the problem.

    (strip out the unimportant scenes/parts/actors/image if you don't want people to see what you're working on).
Sign In or Register to comment.