this is my code so far what do i need to add onto it
import greenfoot.*;
/**
* A user-controlled spaceship that can be teleported from one portal to another
* This class uses a somewhat make-shift move algorithm with drift slowing to stop
* (although, in space, this kind of slowing is not present)
*/
public class Ship extends Actor
{
int speed = 5;
/**
* Method act: move spaceship and check teleporting status
*/
public void act()
{
move();
}
/**
* Method move: checks for keystrokes and applies the changes, then moves the ship.
* I applied a bit of slowing to the ship's speed (so it would be drifting to a stop)
*/
private void move()
{
int dz = 0;
if (Greenfoot.isKeyDown("d")) dz++;
if (Greenfoot.isKeyDown("a")) dz--;
setRotation(getRotation() + dz * 5);
int ds = -1;
if (Greenfoot.isKeyDown("w")) ds += 2;
speed += ds;
if (speed < 0) speed = 0;
if (speed > 90) speed = 90;
if (speed >= 200) move(speed / 100);
if (Greenfoot.isKeyDown("s")) ds += 5;
speed += ds;
if (speed < 5) speed = 5;
if (speed > 200) speed = 200;
if (speed >= 20) move(speed / 10);
}
}