Why are you passing consecutive objects of superclasses to objects being created. When you create a PlayerRocket (or any object), you are creating an object that is considered to be of all its superclass types (Rocket, PhysicalObject, Actor and Object). Extending a class gives any object created from the new class ALL the attributes of ALL the classes it extends.
You got other crazy stuff going on. I presume
x and
y are location coordinates (as double types). I have no clue as to what
z (as a double type) is. The
x and
y values can be set when the actor is added to the world -- in the PhysicalObject class:
protected void addedToWorld(World world) {
this.x = getX();
this.y = getY();
}
There is no need to pass these values as parameters.
I have my own x, y, z coordinates for positioning physical objects in pseudo-3D space. The x, y Actor's values used only for drawing images on screen.
Ok, I just add to game description information, that "Game doesn't work in browser, you need to open it in Greenfoot"