import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* MyCat is your own cat. Get it to do things by writing code in its act method.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MyCat extends Cat
{
/**
* Act - do whatever the MyCat wants to do.
*/
public void act()
{
// checks if cat bored by calling the method "isBored()" which is iherited from the cat class */
if(isBored())
//checks if cat is hungry by calling the method "isHungry()"*/
if(isHungry())
//check if cat is tired
if(tired==true)
//check if cat is alone */
if(isAlone())
{
//If it is bored,then dance
dance();
eat();
sleep(4);
shoutHooray();
}
else
{
shoutHooray();
}
}
}
