I want a cyclops to run at you but I have no Idea where to start. I tried looking for a scenario and I found space chase. It's code is as follows:
but for me it says that it can't find type "player" Help?
1 2 3 4 5 6 7 8 9 | private Player target; public void faceTarget() { //This command makes the ship face an actor. int xDiff = target.getX() - getX(); int yDiff = target.getY() - getY(); double angle = Math.toDegrees(Math.atan2(yDiff, xDiff)); setRotation(( int )Math.round(angle)); } |