-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|686|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
Jayenkai
Created : 10 March 2008
 

The long and winding road...

to insanity!!!!

about 10 or so hours after I started trying to do it, I finally got Platdude on the screen!

My world of Java begins.

ARGH!!!

Quick tests show I can get about 150 16x16pixel sprites onscreen at once.
Given that the screen is only 320x240 to begin with, I can fill about 1/2th of the screen per frame, at about 60fps. (although, honestly, that's a guess. I haven't checked the framerate yet!)

Other options..
  • reduce it to 30fps and keep things completely full.
  • draw the top half, flip, don't clear, draw the bottom half, flip, don't clear, repeat.. Might be the same visible 30fps, but the gameplay would run at 60..
  • Proper framerate control, drawing only once every 2 frames.
  • Figure out buffers.

or, of course, forget about a background, and just fling 150 sprites around on the screen.
Right now, that's the tempting option!

Guess I'll have to keep fiddling, and see what turns up.

 

Comments


Monday, 10 March 2008, 08:07
mike_g
Congrats, nice to hear youre getting this to work.

IMHO action games on phones suck due to the controls. Maybe a puzzle or strategy game of some sort would be better? You could probably get away with less updating of the graphics too.
Tuesday, 11 March 2008, 06:09
Jayenkai
Still, at least you can dump things all over the place in a random frantic order. That's nice.
I'll be honest, Java's a bloody mess, and I can't figure out things properly, so I'll code in a way that will at least work!

Even if that does mean all my code's bundled into one giant .java file!

So I'm happy, then, that I can put variable definitions between functions, and throw everything around above/below each other.
It basically means that I can plonk all the basic setup stuff down near the bottom of the file, where I can ignore it, and keep all my game functions up near the top.

No doubt DD will moan his head off about that, but sod it.. It's working!
Tuesday, 11 March 2008, 09:08
Nolan
I have to admit that the more I work with Java, the more I like it. It was a pain in the ass to start up C++ again in school, and be searching all around for certain functions and messing with pointers.

Not to mention that std::string didn't even seem to have a Split() function?

Anyway, nice job on getting it working!
Wednesday, 12 March 2008, 03:18
Jayenkai
Slower... Slower... SLOWER!!!!

2 days in, and playing with the framerates.
The plan..
Keep the game engine running on one thread, and the drawing on another.

The result.
Worked perfectly...
..
In the emulator, and completely rubbish on the phone.

Nngh.

So, that's about 3 hours I've wasted.
Back to good old "Draw+Move" style things.. At least it works!
But, to keep the thing playable on both fast and slow phones, I've had to cut the framerate down .. to 20 fps!
which sucks!

But at least it works.

Next up, balls!