import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class soilier here. * * @author (your name) * @version (a version number or a date) */ public class soilier extends Actor { int counter = 0; /** * Act - do whatever the soilier wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { public void delay(int 100) if (Greenfoot.isKeyDown("space")) { getWorld().addObject (new shoot (), getX(), getY()-48); } if (Greenfoot.isKeyDown("right")) { move(4); } if (Greenfoot.isKeyDown("left")) { move(-4); } } } // public void delay(100) //{ //if (Greenfoot.isKeyDown("space")) //{ // getWorld().addObject (new shoot (), getX(), getY()-48); //}