Problems creating enemy Update

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
Necrozard
Posts: 14
Joined: Sat Jul 05, 2008 8:49 pm

Problems creating enemy Update

Post by Necrozard »

Hi!

Well im training with irrlicht, im creating the "enemy" right now, the IA, Input check, and here is where i have the problem...

Important Point: Im doing an Function enemy, like:

int Enemy()

And in there i call IAnimatedMeshSceneNode, to set the Mesh, but, i need a Loop, to check the Input, etc.

I tried doing:

while(device->run()), or while(true)

But it always get frozen. I need help with this! The question is how can i do to make a Input Check outside the Main Loop. Thanks!
Baz
Posts: 11
Joined: Fri Jul 04, 2008 12:03 pm

Post by Baz »

i think you should make the input thing without that loop.
if you do "while(device->run())" then it will never end.
so, it will freeze xD

i think you should do something like that

Code: Select all

int scene = 0; // 0 = waiting for input, 1= others (game, or something)

while(device->run()) // main loop
{
   Enemy();
   if (scene ==0)
      Enemy_Input();
   else .... // or maybe you could do this with switch

   //render things
}
so if youre waiting for input, you set scene to 0, and if you inputted something, then set to 1, to use the inputted data, or something.

(i think menus works in the same way :P)
Post Reply