can anyone pls help me out i dont know what to type in my actor class about counter
my world class code -
my score class code-
(i have removed the prepare section from my world class as it was too long while posting this code)
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class MeteoritePopOut here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MeteoritePopOut extends World
{
/**
* Constructor for objects of class MeteoritePopOut.
*
*/
public MeteoritePopOut()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(800, 600, 1);
prepare();
}
/**
* Prepare the world for the start of the program.
* That is: create the initial objects and add them to the world.
*/
score score = new score();
public score getScore()
{
return score;
}
}import greenfoot.*;
import java.awt.Color;
public class score extends Actor
{
int score = 0;
public void act()
{
setImage(new GreenfootImage("Score : "+ score, 34, Color.GREEN, Color.BLACK));
}
public void addscore()
{
score+=2;
}
}