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

2013/6/5

cannot find - prepare(); error

geekykid2013 geekykid2013

2013/6/5

#
when I compile my game I get the following error - cannot find symbol - method prepare(). Can I get help
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class SettingsScreen here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class SettingsScreen extends World
{
    public static Boolean soundOn = true;
    // public static int soundVolume = 100;
    public static Boolean mouseControlOn = true;
    // public static void playsound(String soundFileName)
    //  {
    //      if (Settings.mouseControlOn)
    //          Greenfoot.playSound(soundFileName);
    //  }
    
    /**
     * Constructor for objects of class SettingsScreen
     */
    public SettingsScreen()
    {
        // Create a new world with 700 x 700 cells with a cell size o 1x1 pixels
        super(700, 700, 1);
        
        addObject (new ReturnBackButton(), 130, 650);
        addObject (new ContinueButton(), 570, 650);
        
        addObject (new Label ("SoundToggleLabel.png"), 280, 160);
        addObject (new SoundToggleButton(), 330, 160);
        
        addObject (new Label ("KbMouseToggleLabel.png"), 280, 260);
        addObject (new KeyboardMouseToggleButton(), 330, 260);
    
        prepare();
        {
          
        }
    }
    
}
Kartoffelbrot Kartoffelbrot

2013/6/5

#
There isn't a prepare()-method anywhere.
geekykid2013 geekykid2013

2013/6/5

#
Now I have to set the co-ordinates for my buttons but when I compile the buttons do not moveinto position
 /**
     * Prepare the world for the start of the program. That is: create the initial
     * objects and add them to the world.
     */
    private void prepare()
    {
        SoundToggleButton soundToggleButton = new SoundToggleButton();
        addObject (soundToggleButton, 700, 200);

    }
geekykid2013 geekykid2013

2013/6/5

#
Its ok I manage to solve it now!
Kartoffelbrot Kartoffelbrot

2013/6/5

#
ok
You need to login to post a reply.