Slow motion effect question

VGXVGX Member Posts: 796
edited November -1 in Working with GS (Mac)
Example,

There are 5 Actors,
1 Hero
4 Villains

There is a special pick up that when you touch it, all 4 Villains slow down (slow motion) but the Hero still remains at normal speed.

How would I do this? What rules or attributes do I need to use?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi VeiraGames: roughly, when the pick up is touched, change a boolean to true.

    In the villain's rules, put when that boolean is true
    ---then a separate animate behavior with more frames, running at the same speed as before.

    I can't see any other way of doing it.

    ----------------------------------------------
    http://davidgriffinapps.co.uk/

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • VGXVGX Member Posts: 796
    Thanks will try it
  • RedlerTechRedlerTech Member Posts: 1,583
    Hey Michael,
    Gyros strategy is perfect for animation, but it will not actually slow the enemies down. This way I have not tried yet, but it should work.

    Create a global attributes:
    SlowMotion (integer - 1)

    Create 2 self attributes in the enemy:
    ReturnX (real - 0)
    ReturnY (real - 0)

    Now I'm guessing when you say "if you touch it", you mean if you collide with it.

    (INSIDE THE ENEMY)
    Basically when enemy collides or overlaps with _________ (or if you literally meant touch, then say when touch is released),
    Change Attribute: game.SlowMotion to (game.SlowMotion+1)%2
    Change Attribute: self.ReturnX to self.linearVelocityX
    Change Attribute: self.ReturnY to self.linearVelocityY
    Change Attribute: self.linearVelocityX to self.linearVelocityX / 2
    Change Attribute: self.linearVelocityY to self.linearVelocityY / 2
    Timer after _____ (amount of time slowMotion lasts) seconds (run to completion checked)
    Change Attribute: self.linearVelocityY to self.ReturnY
    Change Attribute: self.linearVelocityX to self.ReturnX

    RULE: When game.slowMotion is 1, play animation at regular fps
    OTHERWISE: play animation at lower fps

    Just note that this is the basics of slow motion and will not go right into your contract. You need to explain exactly how your enemies move. What behaviors are set in the enemy for it to move?

    Matt
    ____________________________________
    Follow Me On Twitter
    Like Me On Facebook
    Check Out My Site For Development Blogs
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Really good stuff, NextGen! The only thing I would say though, is if you just play the animation at a lower fps, your quality of animation would deteriorate, but I guess it's worth experimenting with to see what's acceptable.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • RedlerTechRedlerTech Member Posts: 1,583
    Thanks Gyro!
    I think either way will work, I just think putting more frames will cause the processor to have to 'think' more. Know what I mean?

    ____________________________________
    Follow Me On Twitter
    Like Me On Facebook
    Check Out My Site For Development Blogs
Sign In or Register to comment.