Moving an md2 with ASWD

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
$w!tCh
Posts: 10
Joined: Mon Dec 19, 2005 7:35 am
Location: India

Moving an md2 with ASWD

Post by $w!tCh »

can anyone plz tell me how to move a modell on the key press event???

what i am looking forward to is when i press the W key sydney starts running in an bsp and she is still when no key is pressed.. as per the idea on top of my head i need to set the setMd2animation on key press from stand to run... am i right???

a piece of code on how to do this or reference to any other threads is really appreciated...a newB out here... thanx in advance
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

Pretty much you jsut need to change the FrameLoops depending on what key is being pressed.

Code: Select all

void CCharacter::animateCharacter(enum ENU_ANIM ANIMATION){
	switch(ANIMATION){
		case STAND:
				pCharacterNode->setFrameLoop(21,59);					//0-20 run, 21-59 stand,60-80 walk 
				isAnimated[STAND] = true;
			break;
		case RUN:
			if(isAnimated[RUN] != true){
				pCharacterNode->setFrameLoop(0,20);					//0-20 run, 21-59 stand,60-80 walk 
				isAnimated[RUN] = true;
			}
			break;
	}
}


Thats my animate character function. Not much to look at but hope you get the idea ^_^
area51
Posts: 338
Joined: Thu Mar 18, 2004 10:20 pm
Location: UK
Contact:

Post by area51 »

Alternativly you could download :
http://www.gameputty.com/IrrWizard/

And take a look at the code that generates.
________
Medical marijuana doctor
Post Reply