move an actor : add speed subtract speed

tiestotiesto Member Posts: 122
edited September 2012 in Working with GS (Mac)
hello .
so i want to know what i had to do so when the game begin my actor move right and every 5 seconds his speed increases.
for exemple the game start his speed 100 after 5 secondes his speed 150 .
and when he touch a specific actor (obstacle) his speed decreases.
for exemple his speed 100 and when he collide with obstacle actor his speed 50.
thanks.

Comments

  • TokuharaTokuhara Member Posts: 94
    Create a real attribute inside your actor and call it speed with value of 100

    Behavior Move
    Direction 0
    Speed self.speed

    ------------------

    Behavior Time
    Every 5 seconds
    Behavior Change Attribute
    self.speed to self.speed+50

    ------------------

    Rule
    If actor1 collides or overlaps with actor2
    Behavior Change Attribute
    self.speed to self.speed-50
  • tiestotiesto Member Posts: 122
    very thank you i will test and tell you
  • tiestotiesto Member Posts: 122
    edited September 2012
    yeah it work thanks
Sign In or Register to comment.