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

2020/5/21

Anyone know how to prevent freezing on the transferto a second world?

MYSTICPHOENIXXX MYSTICPHOENIXXX

2020/5/21

#
So, after you beat the first level, you transition to the next one. But, when this had happened Greenfoot had stopped and wouldn't keep on playing! Can anyone help me?
Weeb3.exe Weeb3.exe

2020/5/21

#
show code
MYSTICPHOENIXXX MYSTICPHOENIXXX

2020/5/21

#
Weeb3.exe wrote...
show code
For what class? The only one that can stop Greenfoot is in the "Skythrust" class.
public class Skythrust extends Actor
{
    /**
     * Act - do whatever the Skythrust wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */

    public void act() 
    {
        handleMovement();
        if(isTouching(Bullet.class))
        {
            Greenfoot.stop();
            setImage("G-2.png");
        }

        if(isTouching(Ground.class))
        {
            setImage("Skythrust_2.png");
        }
    }

    public void handleMovement()
    {
        if (Greenfoot.isKeyDown("d"))
        {
            setLocation(getX()+4,getY());
        }
        if (Greenfoot.isKeyDown("a"))
        {
            setLocation(getX()-4,getY());
        }
        if (Greenfoot.isKeyDown("s"))
        {
            setLocation(getX(),getY()+4);
        }
        if (Greenfoot.isKeyDown("w"))
        {
            setLocation(getX(),getY()-4);
        }
    }
   }
MYSTICPHOENIXXX MYSTICPHOENIXXX

2020/5/21

#
MYSTICPHOENIXXX wrote...
Weeb3.exe wrote...
show code
For what class? The only one that can stop Greenfoot is in the "Skythrust" class.
public class Skythrust extends Actor
{
    /**
     * Act - do whatever the Skythrust wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */

    public void act() 
    {
        handleMovement();
        if(isTouching(Bullet.class))
        {
            Greenfoot.stop();
            setImage("G-2.png");
        }

        if(isTouching(Ground.class))
        {
            setImage("Skythrust_2.png");
        }
    }

    public void handleMovement()
    {
        if (Greenfoot.isKeyDown("d"))
        {
            setLocation(getX()+4,getY());
        }
        if (Greenfoot.isKeyDown("a"))
        {
            setLocation(getX()-4,getY());
        }
        if (Greenfoot.isKeyDown("s"))
        {
            setLocation(getX(),getY()+4);
        }
        if (Greenfoot.isKeyDown("w"))
        {
            setLocation(getX(),getY()-4);
        }
    }
   }
Nevermind it's all fixed
You need to login to post a reply.