change the speed of the spawn actor after 10 secound

hi can some one help with the speed of spawn actor after 10 sec.my game is related to the balloon moving in air .i want my balloons to move in some x speed for first 10 sec and later i want that speed to change speed x+20 for every 10 sec.

Comments

  • jsorr2jsorr2 Member Posts: 279
    edited December 2014

    Make a global variable (game.speed).
    Then make an actor somewhere that is in the scene from the beginning, but off the screen or not visible.
    Inside that actor, make a rule, every 10 seconds increase game.speed to game.speed+10

    Then in your balloon actors, make their speed based of game.speed

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

    @shonasen said:
    . . . i want that speed to change speed x+20 for every 10 sec.

    Make your speed:

    x+floor( self.Time /10)*20






    . . . .

    With the above expression the speed value will jump up by 20 every 10 seconds, but if you want the speed to gradually change over time, so that the cumulative result is an increase of 20 every 10 seconds, then use this:

    x+( self.Time *2)

  • shonasenshonasen Member Posts: 40

    thanks @socks and @jsorr2.

Sign In or Register to comment.