speeding up the passe on my endless runner?

CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
so I am working on this strange endless runner project but when im running it seems very slow, so i decided to make it more interesting i would make it so every 10 seconds it would speed up a little, unfortunately i dont know how to do this right, any help would be appreciated, below is what i have for the rules at the moment:

timer = after 10 seconds
move = direction 180degrees at a speed of 120

timer = after 20 seconds
move = direction 180 degrees at a speed of 125

and so on. this rule is placed in all the actors that will move actross the screen including the background, but when this happens they all move at different speeds. not sure what to do :/

Comments

  • LumpAppsLumpApps Member Posts: 2,881
    To make sure they all have the same speed you can constrain their motion velocity x to a game attribute. Name it speed. Negative values mean they go from right to left. Then in a "rule" actor make an every 10 sec timers with a change attribute: change game.speed to game.speed - 5

    The only thing I am worried about with this set up is that you will have a lot of constraints that might cause some performance problems but perhaps it's no biggie.
  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    so @lumpapps do i make an interger attribute?
  • LumpAppsLumpApps Member Posts: 2,881
    Yes that is what I would do. Index must be bigger then zero and you need negative values and unless you want to use fractures you do not need real numbers. So integer is good.
  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    @Lumpapps thanks heaps for this method. I just had to make a few tweeks and got it working great.
    Though since I'm a PC user I don't have the index attribute. Which is a shame because making shops become not so good
  • LumpAppsLumpApps Member Posts: 2,881
    Hm, there must be a math function to do the same. Like change indexnumber to max(0, self.Value ).
  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    @LumpApps mmm didn't think of that haha, I will try this out for my shop quite soon. Thanks!
Sign In or Register to comment.