This site requires JavaScript, please enable it in your browser!
Greenfoot back
tylers
tylers wrote ...

2012/1/29

it keeps saying illegal start of expression help

tylers tylers

2012/1/29

#
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);
    //}
       
tylers tylers

2012/1/29

#
it on line 20
danpost danpost

2012/1/30

#
Check the my reply to 'Identifier expected'.
You need to login to post a reply.