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

2017/12/30

Fullscreen Removal

Cirion Cirion

2017/12/30

#
I used a fullscreen rewriter to give my game fullscreen, but this caused extreme lag so I deleted all the classes for it and now I can't run this because many methods including and limited to the "isKeyDown", "mouseClicked", "getMouseInfo", "getX", and "getY" methods give me a cannot find symbol message. Here is the problem method:
public void checkKeys()
    {
        int walkingCounter = 0; int jumpingCounter = 0;
        animationCounter++;
        
        if (MyWorld.isKeyDown("a") && (getOneObjectAtOffset(getImage().getWidth()/2*-1, 0, immovableObject.class)== null))
        {
            if(animationCounter % 4 == 0) {animateLeft();}
            moveLeft();
        }
        
        if (MyWorld.isKeyDown("d") && (getOneObjectAtOffset(getImage().getWidth()/2, 0, immovableObject.class)== null))
        {
            if(animationCounter % 4 == 0) {animateRight();}
            moveRight();
        }
        //REMOVE AT WORLD EDGE UPON COMPLETION OF TESTING STAGES
        if ((MyWorld.isKeyDown("space" )||MyWorld.isKeyDown("w")))
        {
            //setImage("replaceme.jpg");
           if (onGround()||atWorldEdge()){jump();}
        }
        
        if (MyWorld.mouseClicked(null))
        {
            MyWorld mouse = MyWorld.getMouseInfo();
            if (mouse == null) {return;}
            xMouse = mouse.getX();
            yMouse = mouse.getY();
            shoot();
        }
    }
What can I do to fix this? .
Super_Hippo Super_Hippo

2017/12/30

#
Replace 'MyWorld' with 'Greenfoot'.
Yehuda Yehuda

2017/12/31

#
Also, change line 26 to:
MouseInfo mouse = Greenfoot.getMouseInfo(); // I wrote "Greenfoot." as that's what you're supposed to be doing
Unless MyWorld is the name of a MouseInfo subclass.
You need to login to post a reply.