Animation question please help

Non-platform specific questions.

Animation question please help

Postby krenisis » Sun Jun 20, 2010 2:41 pm

Ok I have 10 animations for a background actor. Lets say the name of the animations is res 1 o10. I need when i press the up button the animation changes in number order. Like if I press up once the animation changes to res2 if I press up again it changes to re3 and so on.
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: Animation question please help

Postby Bee-Ant » Sun Jun 20, 2010 3:59 pm

- Add "res_number" variable (integer) on Background

- Background Keydown->Up:
Code: Select all
char AnimName[16];
res_number++;
sprintf(AnimName,"res%i",res_number);
ChangeAnimation("Event Actor", AnimName, FORWARD);


- Background Keydown->Down:
Code: Select all
char AnimName[16];
res_number--;
sprintf(AnimName,"res%i",res_number);
ChangeAnimation("Event Actor", AnimName, FORWARD);


- Background->DrawActor:
Code: Select all
res_number=max(1,min(res_number,10)); //to keep the res value from 1 to 10


:D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Animation question please help

Postby krenisis » Sun Jun 20, 2010 7:52 pm

Thanks bee-ant because I was going crazy trying to figure it out.
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: Animation question please help

Postby Bee-Ant » Sun Jun 20, 2010 8:07 pm

It's just a matter of time :D
I was the same thing...
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Animation question please help

Postby krenisis » Sun Jun 20, 2010 9:17 pm

Ok I put the code in but for some reason its not moving here is the demo with your code in place.
Attachments
Resident Evil lite.zip
(1.33 MiB) Downloaded 51 times
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: Animation question please help

Postby Bee-Ant » Sun Jun 20, 2010 9:28 pm

Your background animation names are :
- rs1
- rs2
- rs3
- etc...
So, you have to edit this line : (on Keydown)
Code: Select all
sprintf(AnimName,"res%i",res_number);

to :
Code: Select all
sprintf(AnimName,"rs%i",res_number);
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Animation question please help

Postby krenisis » Sun Jun 20, 2010 9:31 pm

Ok i made the change but now once i press up one time the screen goes black
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: Animation question please help

Postby Bee-Ant » Sun Jun 20, 2010 9:54 pm

Move "des" away from view...
Look at des->Collision...
it would destroy anything it touch, no wonder when the BG gets bigger it turned into black :P
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Animation question please help

Postby krenisis » Sun Jun 20, 2010 9:59 pm

Ok i was saying to myself what all those commands for it just to disapper!!! i could have done it simpler....then i look my destroy actor was there...i started to laugh at myself.
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: Animation question please help

Postby lllllsp1d3rlllll » Mon Jun 21, 2010 2:36 am

see thats funny cous i was trying to do that same very thing before and i figure out a neet way to do it
if actor animation lets say 1 animation name is 1
if actor animation =1
play animation 2

if actor animation = 2
play animation 3

so u play a animtion on by one by pressing the same button down matiple times
i know the codes not correct but just a instance
for more from me check out my web site!!!
http://venom-codings.bravehost.com/index.html
lllllsp1d3rlllll
 
Posts: 27
Joined: Sun Dec 13, 2009 6:26 pm
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron