Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-28-2008, 12:07 AM
Member
 
Join Date: Jul 2008
Location: Srilanka
Posts: 3
razmyasdfg is on a distinguished road
Send a message via Yahoo to razmyasdfg
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
Sponsored Links
  #2 (permalink)  
Old 07-28-2008, 12:16 AM
Member
 
Join Date: Jul 2008
Location: Srilanka
Posts: 3
razmyasdfg is on a distinguished road
Send a message via Yahoo to razmyasdfg
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-28-2008, 12:44 AM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,225
Norm is on a distinguished road
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
Sponsored Links
Reply


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

vB 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 11:04 AM
Illegal Start of an Expression David55 CLDC and MIDP 8 11-02-2007 11:11 PM
illegal start of expression & class, interface, or enum expected silverq_82 New To Java 9 08-08-2007 09:16 PM
Illegal start of expression gabriel New To Java 2 08-01-2007 07:09 PM
Illegal Start of an Expression David55 CLDC and MIDP 0 04-20-2007 07:59 AM


All times are GMT +3. The time now is 02:26 PM.


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