import greenfoot.*;
Bullets bullets = new Bullets();
/**
* Write a description of class bullets here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class bullets extends Actor
{
/**
* Act - do whatever the bullets wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(10);
{
fireOnCommand();
}
if(Greenfoot.isTouching(apple.class))
{
removeTouching(alligator.class)
World myWorld = getWord():
myWorld.removeObject (this);
}
}
public void actfireOnComand()
{
if(Greenfoot.isKeyDown("f"));
{
World myWorld = getWorld();
myWorld.addObject(bullets, 0,0);
bullets.setLocation (getX(), getY());
bullets.setRotation (getRotation());
}
}
}
