Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,643 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
simple question about ent_animate #418364
02/24/13 07:06
02/24/13 07:06
Joined: Oct 2012
Posts: 53
K
kenced Offline OP
Junior Member
kenced  Offline OP
Junior Member
K

Joined: Oct 2012
Posts: 53
Hello.

How can I animate back or reverse the animation of the entity smoothly.
I tried this
Code:
int ctr=10;
while(ctr>=0){
	ent_animate(my,"Take",my.skill1,0);
 	my.skill1 -= time_step*7;
        ctr--; 	
        wait(1);
 }



the animation goes back but then its not smoothly animate.
Thanks in advance.

Re: simple question about ent_animate [Re: kenced] #418365
02/24/13 08:16
02/24/13 08:16
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
What are you doing o_0
Remove this ctr and simply check for my.skill1 > 0...

Re: simple question about ent_animate [Re: Ch40zzC0d3r] #418367
02/24/13 08:46
02/24/13 08:46
Joined: Oct 2012
Posts: 53
K
kenced Offline OP
Junior Member
kenced  Offline OP
Junior Member
K

Joined: Oct 2012
Posts: 53
Thanks for response. Sorry,It should be like this?.
Code:
while(my.skill1>0){
		ent_animate(my,"Take",my.skill1,0);
 	  	my.skill1 -= time_step*7;
 	  	wait(1);
 		}


but it do the same thing as the code above. How can I reverse the animation smoothly?.Am I doing it wrong again?.

Re: simple question about ent_animate [Re: kenced] #418373
02/24/13 09:59
02/24/13 09:59
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
hi,
I guess you want to animate the entity and then smoothly animate back to its start position, isn't it?

In that case you can use cosine function for the animation percent.

Code:
var nAngle = 0;
while ( nAngle < 360 )
{
   ent_animate ( me, "Take", 50 - fcos ( nAngle, 50 ), NULL );
   nAngle += time_step * 30;
   wait(1);
}




Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1