INput problem
Posted: Thu Sep 15, 2005 2:30 pm
I used a diferent class for input.
I didnt use MyEventReceiver:public IEventReceiver.
This the code im using:
void cPlayer::Input(SEvent event, sCharacter *Char, ITimer* TimeElapsed, IVideoDriver* driver, ISceneManager* smgr, IrrlichtDevice *device, ICameraSceneNode* camera)
{
float speed =1;
Char->TimeElapsed = TimeElapsed->getRealTime();
if (event.KeyInput.Key == KEY_KEY_W && event.KeyInput.PressedDown)
{
Char->sngWalk = 1;
}
if (event.KeyInput.Key == KEY_KEY_S && event.KeyInput.PressedDown)
{
Char->sngWalk = -1;
}
if (event.KeyInput.Key == KEY_KEY_A && event.KeyInput.PressedDown)
{
Char->sngStrafe = 1;
}
if (event.KeyInput.Key == KEY_KEY_D && event.KeyInput.PressedDown)
{
Char->sngStrafe = -1;
}
Can i do this or i have to use MyEventReceiver class because event is not working working.
Thanks in advance.
I didnt use MyEventReceiver:public IEventReceiver.
This the code im using:
void cPlayer::Input(SEvent event, sCharacter *Char, ITimer* TimeElapsed, IVideoDriver* driver, ISceneManager* smgr, IrrlichtDevice *device, ICameraSceneNode* camera)
{
float speed =1;
Char->TimeElapsed = TimeElapsed->getRealTime();
if (event.KeyInput.Key == KEY_KEY_W && event.KeyInput.PressedDown)
{
Char->sngWalk = 1;
}
if (event.KeyInput.Key == KEY_KEY_S && event.KeyInput.PressedDown)
{
Char->sngWalk = -1;
}
if (event.KeyInput.Key == KEY_KEY_A && event.KeyInput.PressedDown)
{
Char->sngStrafe = 1;
}
if (event.KeyInput.Key == KEY_KEY_D && event.KeyInput.PressedDown)
{
Char->sngStrafe = -1;
}
Can i do this or i have to use MyEventReceiver class because event is not working working.
Thanks in advance.