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 Instructions extends World
{
//Defines the star in the instruction as a GIF
GifImage animation2 = new GifImage("Instructions.gif");
/**
* Constructor for objects of class Instructions.
*
*/
public Instructions()
{
// Create a new world with instructions
super(980, 575, 1);
}
public void act(){
// When space is pressed move on to MyWorld
if ("space".equals(Greenfoot.getKey()))
{ Greenfoot.setWorld(new MyWorld());
}
// Gets current image of gif
setImage(animation2.getCurrentImage());
}
}