Slow Motion HELP please!

FirstDanFirstDan Member Posts: 208
edited March 2012 in Working with GS (Mac)
Hi ALL

I want to add a slow motion power up in my game, i have some actors that interpolate horizontally and in a wave. All i want to do is when you activate the slow motion power up the actors would slow down.

Guidance or an demo would be greatly, greatly appreciated.

You'all rock/

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    If you are using interpolate, you can either interpolate self.speed/velocity to a lower value if game.slowmo is true (otherwise, interpolate to a higher value) or you can interpolate the speed for a longer duration when game.slowmo is true. I would go with the former because the latter would mean that eventually the actor speeds up to normal speed even when game.slowmo is true.

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

  • FirstDanFirstDan Member Posts: 208
    @tatiang - thanks for your reply, i put a display text behaviour on my moving actor and the self.linear velocity x was = 0. Confused to why its zero?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited March 2012
    Its 0 because interpolate isnt a physics behavior. In other words it doesnt apply phyics to the actor to move it. Thats why you can interpolate an actor even if moveable is unchecked in it.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    For speed, I think you'd need to do distance divided by time. So change attribute self.InitialX to self.position.x (put this at the top of the actor's rules) and then Display Text (self.position.x-self.InitialX)/self.time. You'd probably want to use floor, ceiling, or precision with that.

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

  • FirstDanFirstDan Member Posts: 208
    @JohnPapiomitis - ha ok, learned something new today! In this case would I need to slow the duration down within the interpolate behaviour to achieve slow motion?
Sign In or Register to comment.