GetDotted Domains

Viewing Thread:
"Hugo rune Shanks!"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Tue 30/03/04 at 11:23
Regular
"Lisan al-Gaib"
Posts: 7,093
Your a (quite accomplished, by the looks of it) java programmer, what am I doing wrong here?

public class GameScreen extends GameCanvas implements Runnable, CommandListener {
.
. (yada, yada, yada)
.
private PlayerLifeSprite playerLifeSprite[]; // array of classes
.
.
}

public GameScreen(JavaTron midlet,Settings settings,Score score) throws Exception {
super(true);
this.midlet = midlet;
.
.
.
for (int i = 0 ; i < IMAXNUMPLAYERLIVERS ; i++){
playerLifeSprite[i] = new PlayerLifeSprite( playerLifeImage,
PLAYERLIFEWIDTH,
PLAYERLIFEHEIGHT);
}
.
.
.
}

And I'm getting a java.lang.NullPointerException when I run the emulator. Any suggestions?
Tue 30/03/04 at 19:51
Regular
"Eric The Half A Bee"
Posts: 5,347
Pandaemonium wrote:
> Might be a while yet, and it's specifically for the Motorola V300 /
> V500 / V600 series or phones, still, I'll bung it somewhere ;)

I've been wanting to try developing something for mobiles for a while now... I just never seem to get around it it, I've either still got to finish off Applets, or some idot hires me (either that or I'm just too lazy)

Mind if I pick your brains when I finally do get around to it?

> I need to use sprites for score and lives display now, as its just
> crippled (as I expected) my framerate. Damn.

Are you writing it for commercial release, or just to see if you can?
Tue 30/03/04 at 15:49
Regular
"Lisan al-Gaib"
Posts: 7,093
Hugo Rune-Shanks wrote:
> Any chance of posting a link to the game when your done?

Might be a while yet, and it's specifically for the Motorola V300 / V500 / V600 series or phones, still, I'll bung it somewhere ;)

I need to use sprites for score and lives display now, as its just crippled (as I expected) my framerate. Damn.
Tue 30/03/04 at 14:05
Regular
"Eric The Half A Bee"
Posts: 5,347
Pandaemonium wrote:
> Hugo, don't bother. Sorted.


lol... no worries man ;)

Any chance of posting a link to the game when your done?
Tue 30/03/04 at 12:40
Regular
"Lisan al-Gaib"
Posts: 7,093
Hugo, don't bother. Sorted.

PlayerLifeSprite[] playerLifeSprite = new PlayerLifeSprite[MAXNUMPLAYERLIVES];

for (int i = 0 ; i < MAXNUMPLAYERLIVES ; i++){
playerLifeSprite[i] = new PlayerLifeSprite( playerLifeImage, PLAYERLIFEWIDTH, PLAYERLIFEHEIGHT);
}

I didn't initialise the array (grumble, whine, I much prefer C++)
Tue 30/03/04 at 11:55
Regular
"Lisan al-Gaib"
Posts: 7,093
Simon Says wrote:
> private PlayerLifeSprite playerLifeSprite[IMAXNUMPLAYERLIVERS]; //
> array of classes

No, fist thing I tried. Giving a size to the array returns a "]" expected on compilation.

Private static final PlayerLifeSprite playerLifeSprite[IMAXNUMPLAYERLIVERS]; //

also throws an error. >:(
Tue 30/03/04 at 11:27
Regular
"I ush!"
Posts: 922
I'm not a java programmer but java.lang.NullPointerException sounds like an array bounds error type thing to me.

Could it be that your array isn't being initiated with IMAXNUMPLAYERLIVERS elements in it?

Should

private PlayerLifeSprite playerLifeSprite[]; // array of classes

be

private PlayerLifeSprite playerLifeSprite[IMAXNUMPLAYERLIVERS]; // array of classes
Tue 30/03/04 at 11:23
Regular
"Lisan al-Gaib"
Posts: 7,093
Your a (quite accomplished, by the looks of it) java programmer, what am I doing wrong here?

public class GameScreen extends GameCanvas implements Runnable, CommandListener {
.
. (yada, yada, yada)
.
private PlayerLifeSprite playerLifeSprite[]; // array of classes
.
.
}

public GameScreen(JavaTron midlet,Settings settings,Score score) throws Exception {
super(true);
this.midlet = midlet;
.
.
.
for (int i = 0 ; i < IMAXNUMPLAYERLIVERS ; i++){
playerLifeSprite[i] = new PlayerLifeSprite( playerLifeImage,
PLAYERLIFEWIDTH,
PLAYERLIFEHEIGHT);
}
.
.
.
}

And I'm getting a java.lang.NullPointerException when I run the emulator. Any suggestions?

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Great services and friendly support
I have been a subscriber to your service for more than 9 yrs. I have got at least 12 other people to sign up to Freeola. This is due to the great services offered and the responsive friendly support.
Second to none...
So far the services you provide are second to none. Keep up the good work.
Andy

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.