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

2012/1/6

Cannot find symbol- constructor world

mmarboe mmarboe

2012/1/6

#
what does it mean? sorry im pretty new to it
danpost danpost

2012/1/6

#
It means that you deleted the code that creates the world. When you open a 'New' scenario (giving it a name) and create a sub-class for your world, the default constructor method for your world is created in the world class for you. You must have inadvertantly deleted it. Your world class source should look like this when you create a new world class:
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class myWorld here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class myWorld extends World
{

    /**
     * Constructor for objects of class myWorld.
     * 
     */
    public myWorld()
    {    
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(600, 400, 1); 
    }
}
where 'myWorld' would be the name you supplied for your world. Lines 16 through 20 contain the constructor for the world.
mmarboe mmarboe

2012/1/6

#
Thank you! All fixed! The help is very much appreciated!
You need to login to post a reply.