![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on LTE Game Engine Movement Problem within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; The up and down movements work right but when I used square and circle to move left and right, the ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() |
The up and down movements work right but when I used square and circle to move left and right, the object (node) moves diagonally down?
Code: Code:
case KEY_CIRCLE:
case KEY_SQUARE:
{
core::vector3df v = node->getPosition();
v.X += event.KeyInput.Key == KEY_CIRCLE ? 2.0f : -2.0f;
node->setPosition(v);
}
case KEY_CROSS:
case KEY_TRIANGLE:
{
core::vector3df v2 = node->getPosition();
v2.Y += event.KeyInput.Key == KEY_TRIANGLE ? 2.0f : -2.0f;
node->setPosition(v2);
}
Ok, i dont know why it was moving diagonally down, but ive sorted it out by counter-acting the vertical movement so it just moves left and right!
__________________
...Just Returned To The Scene... Last edited by JaSo PsP; 02-13-2007 at 09:10 AM.. Reason: Automerged Doublepost |
|
|
|
|
|
#2 |
![]() ![]() Developer
|
You forgot your breaks;
Code:
case KEY_CIRCLE:
{
} break;
case KEY_SQUARE:
{
core::vector3df v = node->getPosition();
v.X += event.KeyInput.Key == KEY_CIRCLE ? 2.0f : -2.0f;
node->setPosition(v);
} break;
case KEY_CROSS:
{
} break;
case KEY_TRIANGLE:
{
core::vector3df v2 = node->getPosition();
v2.Y += event.KeyInput.Key == KEY_TRIANGLE ? 2.0f : -2.0f;
node->setPosition(v2);
} break;
__________________
[Blog] [Portfolio] [Homebrew Illuminati - Serious Homebrew Development Forums] [I want to make Homebrew FAQ] [How I broke into the Games Industry] [Programming Book List] [Programming Article List] |
|
|
|
![]() |
| Tags |
| engine , game , lte , movement , problem |
| Thread Tools | |
|
|