Slow motion effect question
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?
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
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
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
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
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