Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  help! weird problem  (Read 377 times)
0 Members and 2 Guests are viewing this topic.
Offline Soljaragz

Jr. Member
**

Posts: 55



« on: 2006-02-11 14:41:43 »

In my game, when the character's position is 0 or less, he cant move left (left edge of the game)

My code works when he is walking on ground level (he cant move left when reach edge), but when character is jumping, in the air, then he can MOVE left. i dont know why this happens

my code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
if(key == Event.LEFT)
 {
   if(quix.getXposLeft()<=0)
   {
        quix.isWalkingLeft(false);
        quix.isFaceLeft(true);
   }
}
........................
else if (key == Event.UP)
{
   if(!quix.getJumpLock())
       quix.isJumping(true);
}
Offline magemog

JGO n00b
*

Posts: 30


Jaded Samurai


« Reply #1 on: 2006-02-11 15:35:32 »

It depends what  isWalkingLeft()  does. From its name it would look like it would only stopping the player from -walking- left. If you don't check for isWalkingLeft while in the air then that could be your problem right there.

If that's not it, do you have any sort of momentum, like if you let go, will the player keep going left or right? Seeing how you handle the part that actually moves the player might help.

Hmm... sounds vaguely familiar... yeah
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.054 seconds with 19 queries.