I am making a game with various animals and when i try to add a new class (which the player controls), it says that the constructor has not been defined yet every other animal works. Why is that?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /** * Create a new Turtle and place it randomly */ public void createTurtle() { Turtle newTurtle; newTurtle = new Turtle(); // The error is in this line where it says new Turtle(); World world; world = getWorld(); int worldWidth = world.getWidth(); int worldHeight =world.getHeight(); int x = Greenfoot.getRandomNumber(worldWidth); int y = Greenfoot.getRandomNumber(worldHeight); world.addObject(newTurtle, x, y); } |