How to moving on terrain

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
bigbear
Posts: 7
Joined: Wed Sep 05, 2007 1:28 am

How to moving on terrain

Post by bigbear »

Hi all,

Please help me. I want my character auto moving on terrain, but I don't know the way to do this. Please help me or give me an example to do this.

Thanks for reading.

Big Bear.
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Post by dejai »

What do you mean by auto moving?

If you want it like a scroller their are numerous ways to do this, for a newbie I would just set a invisible object at X corrids with low gravity drawing your player node to it. Then player_node->getPosition in the while loop and if player_node .X position >= to where the invisble scene node is end the game or.. stop the gravity.

For a scroller it would be stop the game..
Programming Blog: http://www.uberwolf.com
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Post by dejai »

Or an easier way would be to set the players direction and rotation and within the while loop do this

while (device->run())
{
vector3df playerforward = player_node->getPosition();
playerforward.X += 1;
}

And if that doesn't work I am not to sure of my code then..


while (device->run())
{
vector3df playerforward = player_node->getPosition();
playerforward.X = playerforward.X + 1;
}
Programming Blog: http://www.uberwolf.com
bigbear
Posts: 7
Joined: Wed Sep 05, 2007 1:28 am

Post by bigbear »

Oh no, it not meaning that. But now, I can do it. Thank you anyway. :D
Post Reply