import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Gun here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class gun extends Actor
{
public void eat()
{
Actor beaty;
beaty=getOneObjectAtOffset(0, 0, beaty.class);
if (beaty != null)
{
World Background;
Background=getWorld();
Background.removeObject(beaty);
}
/* Actor block;
block=getOneObjectAtOffset(0,0,block.class);
if (block != null)
{
World sand_land;
sand_land=getWorld();
sand_land.removeObject(block);
}
*/
}
private int direction, speed;
public gun(int dir)
{
direction = dir;
speed = 10;
}
// public int eaten=0;
//public int bombedFire=0;
public void act()
{
setRotation(direction);
move(speed);
eat();
//bombedFire();
}
}