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

2016/11/22

Repost: Greenfoot not working since about 4 days ago

LakeOtis LakeOtis

2016/11/22

#
It's stuck on "click this window to create the world." Nothing to do with the code- It worked, I added something, found an error, deleted that part, wouldn't compile, restarted Greenfoot, still didn't work, restarted cpu, didn't work. I can also load other files, but I don't want to remake the whole game. Edit: Clicking the window doesn't create the world.
danpost danpost

2016/11/22

#
LakeOtis wrote...
It's stuck on "click this window to create the world." Nothing to do with the code- It worked, I added something, found an error, deleted that part, wouldn't compile, restarted Greenfoot, still didn't work, restarted cpu, didn't work. I can also load other files, but I don't want to remake the whole game. Edit: Clicking the window doesn't create the world.
What did you add and delete? What is the current code for the class you were editing?
LakeOtis LakeOtis

2016/11/23

#
I forget exactly what I added, but I was working on the world class.
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
public class UpperWorld_Peaceful extends World
{

    /**
     * Constructor for objects of class UpperWorld_Peaceful.
     * 
     */
    public UpperWorld_Peaceful()
    {    
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(800, 800, 2); 
        prepare();
    }

    /**
     * Prepare the world for the start of the program.
     * That is: create the initial objects and add them to the world.
     */
    private void prepare()
    {
        You you = new You();
        addObject(you,0,0);
        you.setLocation(0,0);
        you.setLocation(396,382);
        house house = new house();
        addObject(house,360,96);
        coin coin = new coin();
        addObject(coin,658,305);
        coin.setLocation(674,379);
    }
}
I don't think it has anything to do with the code, because it's more the app that isn't working.
Super_Hippo Super_Hippo

2016/11/23

#
Try to remove line 3.
LakeOtis LakeOtis

2016/11/24

#
Super_Hippo wrote...
Try to remove line 3.
I don't understand. Should I remove
prepare();
? because I don't think that does anything. And It isn't anything to do with the code- it's just stuck on the 'to construct the world, click this window.' which doesn't work. I don't see how it really has anything to do with the code. Edit: The reason I don't think the code had anything to do with it is because I can't compile. I can edit, but can't compile.
danpost danpost

2016/11/24

#
LakeOtis wrote...
I don't understand. Should I remove
prepare();
?
No. You need to remove:
/**
The third line from the top of the class. It starts a multi-line comment which does not end until the '*/' on line 10, which makes the class declaration line,
public class UpperWorld_Peaceful extends World
{
a documentation line instead of a line of code the compiler needs to look at.
LakeOtis LakeOtis

2016/11/25

#
danpost wrote...
LakeOtis wrote...
I don't understand. Should I remove
prepare();
?
No. You need to remove:
/**
The third line from the top of the class. It starts a multi-line comment which does not end until the '*/' on line 10, which makes the class declaration line,
public class UpperWorld_Peaceful extends World
{
a documentation line instead of a line of code the compiler needs to look at.
Thanks, I hope it compiles Edit: IT WORKS! THANK YOU!
You need to login to post a reply.