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

2018/4/16

How to make inject move auto, but not transparent other object

Mohhaer Mohhaer

2018/4/16

#
Please help me
Jol159 Jol159

2018/4/16

#
public void flySpaceship()
    {
        move(2);
        if(isAtEdge())
        {
            setLocation(550,250);
        }
    }
The code above will move the spaceship when the code is run at a speed of 2. It will also reset the spaceship to the specified location if it reaches the edge of the game world. Hope this helps a bit!
You need to login to post a reply.