hey i am making this game for a project in school. it is a game where you travel in time and to move on in time you have to answer a question but my problem is that i cant get my score to work. and then i don't know how to make the next question appear after you have answered on the first one. and at last i have a man that have to move up a time line when ever that you has given a correct answer i hope that some one in her can help me i have to be finish on Sunday
World class
my TimeLine class
my ScoreBoard
here is a pic of my game hope that you guys can help me

import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot)
/**
* Write a description of class world here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Timeworld extends World
{
public Counter scoreCounter;
int correctButton;
int Questing_1;
GreenfootSound backgroundmusic = new GreenfootSound("Zack Hemsey - Mind Heist Evolution.mp3");
/**
* Constructor for objects of class world.
*
*/
public Timeworld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(1500, 900, 1);
Counter counter = new Counter();
addObject(counter, 908,48);
addObject(new Man() , 1300 ,800);
addObject(new TimeLine() , 1250 ,450);
addObject(new Questing_1(counter), 320,300);
addObject(new correctButton(), 450,430);
addObject(new buttonEorror(), 350,430);
addObject(new buttonEorror(), 250,430);
}
public void act()
{
Counter counter = new Counter();
if (Greenfoot.isKeyDown("2"))
{
addObject(new Questing_2(counter), 320, 300);
addObject(new correctButton(), 250,430);
addObject(new buttonEorror(), 350,430);
addObject(new buttonEorror(), 450,430);
}
if (Greenfoot.isKeyDown("3"))
{
addObject(new Questing_3(counter), 320, 300);
addObject(new correctButton(), 250,430);
addObject(new buttonEorror(), 350,430);
addObject(new buttonEorror(), 450,430);
}
if (Greenfoot.isKeyDown("4"))
{
addObject(new Questing_4(counter), 320, 300);
addObject(new correctButton(), 350,430);
addObject(new buttonEorror(), 250,430);
addObject(new buttonEorror(), 450,430);
}
if (Greenfoot.isKeyDown("5"))
{
addObject(new Questing_5(counter), 320, 300);
addObject(new correctButton(), 250,430);
addObject(new buttonEorror(), 350,430);
addObject(new buttonEorror(), 450,430);
}
}
public void started()
{
backgroundmusic.play();
}
public void gameOver()
{
addObject(new ScoreBoard(scoreCounter.getValue()),getWidth()/2,getHeight()/2);
Greenfoot.playSound("Sons Of Odin - Patrick Doyle.mp3");
if(backgroundmusic.isPlaying())
{
backgroundmusic.stop();
}
}
public void countScore(int score)
{
scoreCounter.add(score);
}
}
All the Questions classes
[code]import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Instructions here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Questing_1 extends Actor
{
private Counter counter;
public GreenfootImage Questing_1 = new GreenfootImage("Questing_1.png");
public Questing_1(Counter pointCounter)
{
counter = pointCounter;
}
public void act()
{
Actor correctButton = getOneObjectAtOffset(450, 430, correctButton.class);
if (Greenfoot.mouseClicked(correctButton)&&(this!= null))
{
counter.add(10);
getWorld().removeObject(this);
}
}
}
public class Questing_2 extends Actor
{
private Counter counter;
private GreenfootImage Questing_2 = new GreenfootImage("Questing_2.png");
public Questing_2(Counter pointCounter)
{
counter = pointCounter;
}
public void act()
{
Actor correctButton = getOneObjectAtOffset(250, 430, correctButton.class);
if (Greenfoot.mouseClicked(correctButton))
{
counter.add(10);
getWorld().removeObject(this);
}
}
}
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Questing_3 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Questing_3 extends Actor
{
private Counter counter;
private GreenfootImage Questing_1 = new GreenfootImage("Questing_3.png");
public Questing_3(Counter pointCounter)
{
counter = pointCounter;
}
public void act()
{
Actor correctButton = getOneObjectAtOffset(250, 430, correctButton.class);
if (Greenfoot.mouseClicked(correctButton))
{
counter.add(10);
getWorld().removeObject(this);
}
}
}
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Questing_4 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Questing_4 extends Actor
{
private Counter counter;
private GreenfootImage Questing_1 = new GreenfootImage("Questing_4.png");
public Questing_4(Counter pointCounter)
{
counter = pointCounter;
}
public void act()
{
Actor correctButton = getOneObjectAtOffset(350, 430, correctButton.class);
if (Greenfoot.mouseClicked(correctButton))
{
counter.add(10);
getWorld().removeObject(this);
}
}
}
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Questing_5 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Questing_5 extends Actor
{
private Counter counter;
private GreenfootImage Questing_1 = new GreenfootImage("Questing_5.png");
public Questing_5(Counter pointCounter)
{
counter = pointCounter;
}
public void act()
{
Actor correctButton = getOneObjectAtOffset(250, 430, correctButton.class);
if (Greenfoot.mouseClicked(correctButton))
{
counter.add(10);
getWorld().removeObject(this);
}
}
}
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class TimeLine here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class TimeLine extends Actor
{
private GreenfootImage TimeLine = new GreenfootImage("TimeLine.png");
}
import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot)
import java.awt.Color;
import java.awt.Font;
import java.util.Calendar;
public class ScoreBoard extends Actor
{
public static final float FONT_SIZE = 48.0f;
public static final int WIDTH = 400;
public static final int HEIGHT = 300;
/**
* Create a score board with dummy result for testing.
*/
public ScoreBoard()
{
this(100);
}
/**
* Create a score board for the final result.
*/
public ScoreBoard(int score)
{
makeImage("Game Over", "Score: ", score);
}
/**
* Make the score board image.
*/
private void makeImage(String title, String prefix, int score)
{
GreenfootImage image = new GreenfootImage(WIDTH, HEIGHT);
image.setColor(new Color(0,255,255, 128));
image.fillRect(0, 0, WIDTH, HEIGHT);
image.setColor(new Color(0, 0, 0, 128));
image.fillRect(5, 5, WIDTH-10, HEIGHT-10);
Font font = image.getFont();
font = font.deriveFont(FONT_SIZE);
image.setFont(font);
image.setColor(Color.WHITE);
image.drawString(title, 60, 100);
image.drawString(prefix + score, 60, 200);
setImage(image);
}
}
my buttonEorror class
[code]import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class buttomEorror_1 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class buttonEorror extends Actor
{
private boolean onThis=false;
public void act()
{
{
if(Greenfoot.mouseMoved(null))
onThis = Greenfoot.mouseMoved(this);
if(onThis)
setImage("ButtonPressed.png");
else
setImage("Buttonnotpress.png");
}
Actor correctButton = getOneIntersectingObject(correctButton.class);
if (Greenfoot.mouseClicked(correctButton))
{
getWorld().removeObject(this);
}
if (Greenfoot.mouseClicked(this))
{
Timeworld Timeworld = (Timeworld)getWorld();
GameOver gameover = new GameOver();
Timeworld.gameOver();
}
my counter class
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
/**
* A simple counter with graphical representation as an actor on screen.
*
* @author mik
* @version 1.0
*/
public class Counter extends Actor
{
private static final Color transparent = new Color(0,0,0,0);
private GreenfootImage background;
private int value;
private int target;
/**
* Create a new counter, initialised to 0.
*/
public Counter()
{
background = getImage(); // get image from class
value = 0;
target = 0;
updateImage();
}
/**
* Animate the display to count up (or down) to the current target value.
*/
public void act()
{
if (value < target) {
value++;
updateImage();
}
else if (value > target) {
value--;
updateImage();
}
}
/**
* Add a new score to the current counter value.
*/
public void add(int score)
{
target += score;
}
/**
* Return the current counter value.
*/
public int getValue()
{
return value;
}
/**
* Set a new counter value.
*/
public void setValue(int newValue)
{
target = newValue;
value = newValue;
updateImage();
}
/**
* Update the image on screen to show the current value.
*/
private void updateImage()
{
GreenfootImage image = new GreenfootImage(background);
GreenfootImage text = new GreenfootImage("" + value, 22, Color.BLACK, transparent);
image.drawImage(text, (image.getWidth()-text.getWidth())/2,
(image.getHeight()-text.getHeight())/2);
setImage(image);
}
}
my Man class
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class man here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Man extends Actor
{
public void act()
{
}
}


