import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* You play this tank.
*
* @author: Mika Filoteo
* @version
*/
public class Good_Tank extends Actor
{
World world;
int f=0;
int m=0;
int mcount=0;
int count=0;
public void act()
{
if(Greenfoot.isKeyDown("right"))
{
setRotation(0);
move(5);
}
if(Greenfoot.isKeyDown("up"))
{
setLocation(getX(), getY()-5);
}
if(Greenfoot.isKeyDown("down"))
{
setLocation(getX(), getY()+5);
}
if(Greenfoot.isKeyDown("left"))
{
setRotation(0);
move(-5);
}
if(Greenfoot.isKeyDown("z"))
{
f++;
if(f==1)
{
Bullet bullet = new Bullet();
getWorld().addObject(bullet, getX(), getY());
bullet.setRotation(getRotation());
}
if(f==50)
f=0;
}
else
f=0;
Actor Good_Tank;
Good_Tank = getOneObjectAtOffset(0,0,Good_Tank.class);
if (Good_Tank != null)
{
Greenfoot.getWorld(new Game_Over_Screen());
world.removeObjects(world.getObjects(null));
}
if (world != null)
{
world.removeObjects(world.getObjects(null));
}
}
}

