This site requires JavaScript, please enable it in your browser!
Greenfoot back
Tavi
Tavi wrote ...

2013/10/23

Need an object fixed to the screen, not the map.

1
2
3
4
SPower SPower

2013/10/31

#
Or maybe change the method checkCameraUpMovement to:
private void checkCameraUpMovement()
{
    getWorld().setCameraLocation(getWorld().getCameraX(), getGlobalY());
}
I'm not sure if this will work though, but it's worth testing.
Tavi Tavi

2013/10/31

#
if i implement "I think I'm coming close to cracking the nuts!" code, the camera freezes and i cant walk left at all anymore, and if i walk right i walk right out of the screen.. i think we're either missing some code or something went wrong.. Other then that, im still playing with the max up dist to try and make that work :) EDIT: Is it possible to send PM's on greenfoot or does that happen via email?
SPower SPower

2013/10/31

#
Whoops, I made an error again. This may work:
if (Greenfoot.isKeyDown("left"))      
        {      
            sequence = 3;      
            richting = 2;  
            if (getXFromCamera() > 0) {  
                move(-MOVE_AMOUNT);  
            } else {  
                int cx = getWorld().getCameraX();    
                getWorld().moveCamera(-MOVE_AMOUNT);  
               if (getWorld().getCameraX() == cx) {  
                    move(-MOVE_AMOUNT);  
               }  
            }  
        }  
if (Greenfoot.isKeyDown("right"))      
        {      
            sequence = 3;      
            richting = 2;  
            if (getXFromCamera() < 0) {  
                move(MOVE_AMOUNT);  
            } else {  
                int cx = getWorld().getCameraX();    
                getWorld().moveCamera(-MOVE_AMOUNT);  
               if (getWorld().getCameraX() == cx) {  
                    move(MOVE_AMOUNT);  
               }  
            }  
        }
And again, maybe you need to change the method checkCameraUpMovement to what I said earlier :)
Tavi Tavi

2013/10/31

#
Again, no camera movement.. and the new camera up method makes the game extremely buggy.. :( if i jump i jump an entire floor.. ( wayyy to high) and the new walk method freezes the entire camera! I'm hoping you could help me out in a more personal matter, else it might take a very long time.. I've sent a short email to the gmail adress on your account :) .. hopefully we can resolve this issue, I Will post the entire game early next week.
You need to login to post a reply.
1
2
3
4