CHANGE ANIMATION RANDOMLY WHEN CLICKED?

Game Editor comments and discussion.

CHANGE ANIMATION RANDOMLY WHEN CLICKED?

Postby lordezak » Mon Jan 21, 2008 7:45 pm

can anyone tell me if i can (by the push of a button) make the animation change between 2 animations from the original. :D
if i need script then the two animations (preloaded to character) are 'yes' and 'no'
plz include them in the script (if script is needed) if not brill :D
the computer world is bigger than the real one!
User avatar
lordezak
 
Posts: 15
Joined: Sat Jan 12, 2008 1:52 pm
Score: 2 Give a positive score

Re: CHANGE ANIMATION RANDOMLY WHEN CLICKED?

Postby DarkParadox » Mon Jan 21, 2008 8:47 pm

is it toggle?
like if it's yes it turns to no?

if it's random:
Code: Select all
int var;
var = rand(2);
if(var == 1){animindex = 0;}
if(var == 2){animindex = 1;}


if it's toggle:
Code: Select all
animindex =! animindex;

if you want it to check the animation:
create a variable called yes and put this in the code:
Code: Select all
if(animindex== 0){yes = 1;}//the first frame
if(animindex == 1){yes = 0;}//the second frame
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: CHANGE ANIMATION RANDOMLY WHEN CLICKED?

Postby DarkParadox » Tue Jan 22, 2008 8:19 pm

got your message, try these codes.

Code: Select all
int var;
var = rand(2);
if(var == 1){animpos = 0;}
if(var == 2){animpos = 1;}


if it's toggle:


Code: Select all
animpos =! animpos;

if you want it to check the animation:
create a variable called yes and put this in the code:


Code: Select all
if(animpos== 0){yes = 1;}//the first frame
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron