i have a Ship class that fires a Bullet but instead of it adding the bullet above the ship like it is supposed to it adds it to the side of the ship here is the code that is in the ship.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Ship extends Mover { private int gunReloadTime; // The minimum delay between firing the gun. private int reloadDelayCount; // How long ago we fired the gun the last time. private Vector acceleration; // How fast the rocket is. private int shotsFired; // Number of shots fired. public Ship() { gunReloadTime = 20; reloadDelayCount = 0; acceleration = new Vector(0, 0.3); increaseSpeed(new Vector(13, 0.3)); // initially slowly drifting shotsFired = 0; } /** * Act - do whatever the Ship wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { checkKeys(); reloadDelayCount++; } public void checkKeys() { if(Greenfoot.isKeyDown("right")) { moveRight(); } if(Greenfoot.isKeyDown("left")) { moveLeft(); } if(Greenfoot.isKeyDown("space")) { fire(); } } public int getSpeed() { return (int) (getMovement().getLength() * 10); } /** * Set the time needed for re-loading the rocket's gun. The shorter this time is, * the faster the rocket can fire. The (initial) standard time is 20. */ public void setGunReloadTime(int reloadTime) { gunReloadTime = reloadTime; } private void fire() { if(reloadDelayCount >= gunReloadTime) { Bullet b = new Bullet(getMovement().copy(), getRotation()); getWorld().addObject(b, getX(), getY()); b.move(); shotsFired++; reloadDelayCount = 0; } } }