QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

LTE Game Engine Movement Problem

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 ...

Reply
 
LinkBack Thread Tools
Old 02-13-2007, 09:10 AM   #1
 
 
My Mood: Bored
Join Date: Apr 2006
Location: England ~¦¦¦|+|¦¦¦~
Posts: 1,112
Trader Feedback: 0
Default LTE Game Engine Movement Problem

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);
                   }
-= Double Post =-
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
JaSo PsP is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-13-2007, 10:04 AM   #2

Developer
 
yaustar's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 2,317
Trader Feedback: 0
Default

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;
yaustar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
engine , game , lte , movement , problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 05:10 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us