Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-27-2008, 11:07 PM
Member
 
Join Date: Jul 2008
Location: Srilanka
Posts: 3
Rep Power: 0
razmyasdfg is on a distinguished road
Send a message via Yahoo to razmyasdfg
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
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-27-2008, 11:16 PM
Member
 
Join Date: Jul 2008
Location: Srilanka
Posts: 3
Rep Power: 0
razmyasdfg is on a distinguished road
Send a message via Yahoo to razmyasdfg
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;
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-27-2008, 11:44 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SouthWest Missouri, USA
Posts: 2,229
Rep Power: 4
Norm is on a distinguished road
Default
I don't see the error message.
Quote:
the illegal start of expression error
The compiler will show you where the error occured.
Copy and paste the error message here.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
illegal character: \92 jlgraham New To Java 3 06-29-2008 10:04 AM
Illegal Start of an Expression David55 CLDC and MIDP 8 11-02-2007 10:11 PM
illegal start of expression & class, interface, or enum expected silverq_82 New To Java 9 08-08-2007 08:16 PM
Illegal start of expression gabriel New To Java 2 08-01-2007 06:09 PM
Illegal Start of an Expression David55 CLDC and MIDP 0 04-20-2007 06:59 AM


All times are GMT +2. The time now is 07:01 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org