i am quitte new to java and greenfoot so i dont know to fix the error i am getting.
i am getting the error in class "Fighter_Kogel" at line 9. This is a subclass of "Kogel"
error:
constructor Kogel in class Kogel cannot be applied to given types;
trquired: int
found: no arguments
reason: actual and formal arguments lists differ in length
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Fighter_Kogel here. * * @author (your name) * @version (a version number or a date) */ public class Fighter_Kogel extends Kogel { /** * Act - do whatever the Fighter_Kogel wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { // Add your action code here. } }
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Kogel here. * * @author (your name) * @version (a version number or a date) */ public class Kogel extends beweeg { private Speler speler; private int kogelSnelheid = 5; private int richting; /** * Act - do whatever the Kogel wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { geschoten(); move(kogelSnelheid); } /* public Kogel(Speler speler) { this.speler = speler; } */ public void geschoten() { int ypos = getY(); int xpos = getX(); if (ypos < 5 || xpos < 5 || ypos > 763 || xpos > 1361){ getWorld().removeObject(this); } } public Kogel(int rot) { setRotation(rot); if (rot > 0 && rot < 90) { setRotation(0); } if (rot > 90 && rot < 180) { setRotation(90); } if (rot > 180 && rot < 270) { setRotation(180); } if (rot > 270 && rot < 360) { setRotation(270); } } }