Change Animation using script editor...

Non-platform specific questions.

Change Animation using script editor...

Postby IPete2 » Sun Feb 06, 2005 10:42 pm

Hi team,

I am now getting to grips with simple scripting. Wow the power underneath GE is really cool!

However, I have a little question. I am using the following code with a global variable called 'moveme' :

if (moveme==1)
{
y=y-4;
ChangeAnimation("ducky","Duck001","FORWARD");
}


'moveme' is set by a routine which checks if a key is held down.

The problem is that if the key is held down - no animation runs because it is always resetting, because the key is held.

Is there another way to achieve change animation in scripting please?

I could use a counter but that seems a bit lame in C. Any thoughts?

IPete2.
IPete2
 
Posts: 43
Joined: Sun Jan 30, 2005 4:06 pm
Score: 0 Give a positive score

Postby jazz_e_bob » Sun Feb 06, 2005 10:58 pm

if ( animIndex != [put animIndex for Duck001 here] )
ChangeAnimation("ducky","Duck001","FORWARD");



Makslane - See thread:
http://www.game-editor.com/forum/viewtopic.php?t=285&highlight=animindex

If implemented you could use:
if ( animIndex != animIndex(Duck001) )
ChangeAnimation("ducky","Duck001","FORWARD");
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby IPete2 » Sun Feb 06, 2005 11:51 pm

Jazz,

You are a star!

I shall try that out right now!

Thanks dude!

IPete2.
IPete2
 
Posts: 43
Joined: Sun Jan 30, 2005 4:06 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest