total n00b here, major help needed

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
Chaosdragondz

total n00b here, major help needed

Post by Chaosdragondz »

I have an animated character, and i want to make it so when you press W on your keyboard, the character moves forward, while displaying a running animation, and when no button are presssed, an idle animation is displayed. I know i must know C++, but i looked at some tutorials, and am totally confused, so if anybody could give me an example or something, i could teach myself how
Rabid Mantis
Posts: 61
Joined: Sun May 08, 2005 11:30 am

Post by Rabid Mantis »

the tutorials are examples. take more time to study the code and learn it a piece at a time.
Ced666
Posts: 86
Joined: Fri Jan 13, 2006 10:29 am
Location: Belgium

Post by Ced666 »

Before learning the tutorials, you should learn C++. Find some good books about C++ programming (in general, not only game programming) and after some time (can be long), once you know the syntax well and already some small programs, then you can look more in details at the tutorials. Otherwise, you'll get totally lost if you don't know the language itself.
TheWorstCoderEver
Posts: 47
Joined: Wed Feb 01, 2006 8:09 pm
Location: Wroclaw
Contact:

Post by TheWorstCoderEver »

The problem's not that complicated since I managed to solve it by myself. :lol:
Create your own entities that the scene nodes will represent and add member variables to describe their states. Example taken from my own code snippet:

Code: Select all


if (this->state!=STATE_WALK)
   {
      this->state=STATE_WALK;
      this->model->setMD2Animation("run");
      this->model->setLoopMode(true);
   } 
"This" refers to the entity. "Model" is the scene node that serves as its representation. To reverse the process, add a method for stopping entity's movement:

Code: Select all

void Character::Stop()
{
   this->state=STATE_STAND;
   this->model->setMD2Animation("stand");
}
... and voila! You have an animated character that blindly obeys your merciless orders. No worry, the best's still ahead - namely creating editor to place the actual content on the map or figuring out pathfinding algorithms. May the force be with you!
Post Reply