This site requires JavaScript, please enable it in your browser!
Greenfoot back
Asuna
Asuna wrote ...

2018/4/8

Whats the Problem?

Asuna Asuna

2018/4/8

#
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Beuteltierwelt here. * * @author (your name) * @version (a version number or a date) */ public class Beuteltierwelt extends World { /** * Constructor for objects of class Beuteltierwelt. * */ public Beuteltierwelt() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(16, 9, 60); addObject(new Beuteltier(), 0, 0); for(int i = 0; i < 5;i++){ BlattHinzufügen(); } } public void BlattHinzufügen(){ addObject(new Blatt(), Greenfoot.getRandomNumber(16), Greenfoot.getRandomNumber(9)); } public void löscheObjekte(){ list objekte = getObjects(null); removeObjects(objekte); setBackground("Game Over!.png"); } } At public void löscheObjekte there is a Problem with the word List : cannot find Symbol - class list, Why??
danpost danpost

2018/4/8

#
Avoid naming a List object (btw, the type is List -- not list) by combining the problem line with the line below it (which uses the list):
removeObjects(getObjects(null));
Otherwise you would need to import the java.util.List class (by code).
You need to login to post a reply.