ill taake it out
thats where i thought you wanted me to put it originally but i forgot to take it out
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Invader here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Invader extends Actor
{
/**
* Act - do whatever the Invader wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
Actor playermissile = getOneIntersectingObject(PlayerMissile.class);
if (getY() == getWorld().getHeight() -1)
{
Space space = (Space) getWorld();
Lifeboard lBoard = space.lifeboard;
getWorld().removeObject(this);
getWorld().removeObject(lBoard);
setLocation(400,300);
this.setImage("gameover.jpg");
Greenfoot.stop();
return;
}
if(playermissile != null)
{
Space space = (Space) getWorld();
Scoreboard sBoard = space.scoreboard;
space.scoreboard.add(10);
getWorld().removeObject(playermissile);
getWorld().removeObject(this);
}
}
public boolean invaderBelow()
{
if(getOneObjectAtOffset(0, 60, Invader.class) == null)
{
return false;
}
else
{
return true;
}
}
}public void started()
{
if (!getObjects(GameOver.class).isEmpty()) Greenfoot.stop();
}import greenfoot.*;
public class GameOver extends Actor
{
int score = 0;
private GreenfootImage gameover;
public GameOver()
{
updateBoard();
}
private void updateBoard()
{
if (score == 1)
{
setLocation(400,300);
setImage(gameover);
return;
}
}
public void add(int addVal)
{
score += addVal; updateBoard();
}
public int getScore()
{
return score;
}
public void addedToWorld(World world)
{
gameover = new GreenfootImage("gameover.png");
}
}