Changing the speed of a moving object!

Hi Gamesalad Community,

In my game that i am currently working on, i have an object (Main Character) consistently moving forward using the "Move" rule. However, i can't seem to figure something out. When this object collides with another object, i want the speed to decrease. Can someone help me. I hope i have explained it clear enough. :)

Thanks.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    Move [direction=some value] [speed=self.Speed]

    When actor collides with [other actor]
         Change attribute self.Speed to [reduced speed value]
    Otherwise
         Change attribute self.Speed to [normal speed value]

    If you want the actor to permanently slow down AFTER it has collides with another object, you'll need to change a boolean value and set the rule condition to true or false for that boolean.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.