Make an animation work for 5 seconds
by Liam Shalon · in Torque Game Builder · 07/18/2012 (10:14 pm) · 11 replies
Hi,
I'm making a powerup where when the player touches it, it slows it down for 5 seconds.
so I'm thinking of using an if statement to see if the player touches the powerup and then a do while statement to that it slows down the character while the timer hasn't hit 0. any suggestions?
I'm making a powerup where when the player touches it, it slows it down for 5 seconds.
so I'm thinking of using an if statement to see if the player touches the powerup and then a do while statement to that it slows down the character while the timer hasn't hit 0. any suggestions?
About the author
#2
You could swap the player with another sprite ( I am developing T3D so i might not be using the right terms ) that sprite should play a slowed down animation, then make a schedule when the schedule ends swap the sprite back to the original one.
Or you could do some engine code to make a, slow down animations function.
Of course i don't own TGB neither developed in it so i might be wrong or not know a better way.
07/19/2012 (4:36 am)
$timeScale should slowdown the whole game not just that single animation.You could swap the player with another sprite ( I am developing T3D so i might not be using the right terms ) that sprite should play a slowed down animation, then make a schedule when the schedule ends swap the sprite back to the original one.
Or you could do some engine code to make a, slow down animations function.
Of course i don't own TGB neither developed in it so i might be wrong or not know a better way.
#3
So the question is, would time scale work in that case?
and
Is there a way to just simply slowdown the character for 5 seconds, maybe set the %val down for 5 seconds.
and if someone thinks that that could work could someone send me a example?
07/19/2012 (8:27 am)
well, if it slowed down the entire game that would actually be the best thing for me. But if it does slow down the entire game then would the score slowdown too? The score goes up by the second and the more seconds the player survives the higher his score is. So the question is, would time scale work in that case?
and
Is there a way to just simply slowdown the character for 5 seconds, maybe set the %val down for 5 seconds.
and if someone thinks that that could work could someone send me a example?
#4
07/19/2012 (8:28 am)
in other words, how do I put the %val down for a timer of 5 seconds or 10 or 15
#5
whether the score slows down aswell depends on how you handle it. I believe using the $timescale will slow down the amount of ticks the game is running at. So if you calculate the score based on the real time spent it wont slow down the score but instead slow down the rate at which the score is updated at.
07/19/2012 (12:18 pm)
If you just wanna slow the characters movementspeed you might wanna have a look at this tutorialwhether the score slows down aswell depends on how you handle it. I believe using the $timescale will slow down the amount of ticks the game is running at. So if you calculate the score based on the real time spent it wont slow down the score but instead slow down the rate at which the score is updated at.
#6
07/19/2012 (12:36 pm)
ya.
#7
07/19/2012 (2:06 pm)
so ya, I'll do that but how do I set the timer?
#9
07/19/2012 (2:26 pm)
Yes! Thank you. The only think that I still have a question about is 1. Should I just move it so that the sensitivity goes down 2. Should I put this into a "if player touches powerup do sensitivity down while the 5 seconds goes. I am programming on itorque just saying
#10
07/19/2012 (2:28 pm)
Oh yeah, I don't know anything about sensitivity but it sounds like you would just need to set it down when beginning the schedule and putting it back up when the schedule has finished :)
#11
if
(Player hits Powerup)
Do
(set sensitivity down)
While
(5 seconds)
Secondly I have a question unrelated to this, how do I move the camera so it keeps going up and if my player hits the bottom edge they die.
07/19/2012 (2:46 pm)
asuming that I have all of my classes sorted out I would be able to make it like this:if
(Player hits Powerup)
Do
(set sensitivity down)
While
(5 seconds)
Secondly I have a question unrelated to this, how do I move the camera so it keeps going up and if my player hits the bottom edge they die.
Torque Owner DreamPharaoh
Gods and Nemesis