Results 1 to 3 of 3
  1. #1
    razmyasdfg is offline Member
    Join Date
    Jul 2008
    Location
    London (Kingsbury)
    Posts
    41
    Rep Power
    0

    Default illegal start of expression

    Hi guys i am Razmy i am very new to this forum last night i was working on my final project my project is a mobile game its a small game

    when i try to write a new methode the illegal start of expression error

    this is the method that i wrote

    public void level() {

    g.setColor(255, 255, 255); // white
    g.setFont(Font.getFont(Font.FACE_MONOSPACE, Font.STYLE_BOLD, Font.SIZE_LARGE));
    g.drawString("Leve 2", 90, 40, Graphics.TOP | Graphics.HCENTER);

    int keyState = getKeyStates();
    if ((keyState & FIRE_PRESSED)!=0) {

    fishSprite.setPosition(2,77);
    }

    for (int i = 0; i < 3; i++) {
    x_enemySprite[i].move(x_enemyXSpeed[i],0);
    checkBounds(x_enemySprite[i], true);
    x_enemySprite[i].paint(g);
    }
    }

    if any one know plz help me


    thank you

  2. #2
    razmyasdfg is offline Member
    Join Date
    Jul 2008
    Location
    London (Kingsbury)
    Posts
    41
    Rep Power
    0

    Default using Random

    hi i need to use the random for set the position for a sprite
    this is my code if anyone knows plz help me

    here is my code

    x_enemySprite[0] = new Sprite(Image.createImage("/E4.png"));
    x_enemySprite[0].setPosition(0,27);
    x_enemyXSpeed[0] = -2;

    x_enemySprite[1] = new Sprite(Image.createImage("/E5.png"));
    x_enemySprite[1].setPosition(52,10);
    x_enemyXSpeed[1] = -2;

    x_enemySprite[2] = new Sprite(Image.createImage("/E6.png"));
    x_enemySprite[2].setPosition(30,20);
    x_enemyXSpeed[2] = -2;

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default

    I don't see the error message.
    the illegal start of expression error
    The compiler will show you where the error occured.
    Copy and paste the error message here.

Similar Threads

  1. illegal character: \92
    By jlgraham in forum New To Java
    Replies: 3
    Last Post: 06-29-2008, 09:04 AM
  2. Illegal Start of an Expression
    By David55 in forum CLDC and MIDP
    Replies: 8
    Last Post: 11-02-2007, 09:11 PM
  3. Replies: 9
    Last Post: 08-08-2007, 07:16 PM
  4. Illegal start of expression
    By gabriel in forum New To Java
    Replies: 2
    Last Post: 08-01-2007, 05:09 PM
  5. Illegal Start of an Expression
    By David55 in forum CLDC and MIDP
    Replies: 0
    Last Post: 04-20-2007, 05:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •