Controls don't work properly.
Posted: Sun Jun 11, 2006 7:38 am
My code:
Negative movements don't work (left/down), why?
Thanks.
Code: Select all
if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT&&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_S:
{
core::vector3df v = cow->getPosition();
v.Y -=2.0f;
cow->setPosition(v);
}
case KEY_KEY_Z:
{
core::vector3df v = cow->getPosition();
v.Y +=2.0f;
cow->setPosition(v);
}
case KEY_KEY_Q:
{
core::vector3df v = cow->getPosition();
v.X -=2.0f;
cow->setPosition(v);
}
case KEY_KEY_D:
{
core::vector3df v = cow->getPosition();
v.X +=2.0f;
cow->setPosition(v);
}
//return true;
}
}
Thanks.