Advice needed for J2me game

A

alessandro.saccoia

Hello list,
I am new to J2me and game programming in general. Until now I did the
skeleton of a scrolling game a la Supermario Bros. I managed to make
the game level, the player character moving around, the scrolling
background and some realy basic enemies. I have 3 questions because I'm
stuck with populating the game level with obstacles and enemies.
Imagine the character is going on in the game and new enemies always
appear.

1st question: Should I define the position of the enemies in the
beginning of the game so they start moving when they see the character
approaching or should I test the position of the character and create
the enemies on the fly adding them to the game basing the creation upon
the current x position of the player? These would require testing a lot
of things every frame, but would save some heap space that is so
limited in J2me. If I was without memory problems I would surely go for
the first choice.

2nd question: I programmed the scrolling background as a sprite, but as
the game gets longer the PNG image gets bigger until
OutOfMemoryException. I wonder if using the same 256 colors for every
object drawn can reduce the memory usage and if there is a way to tell
the environment to limit the palette to these 256 colors.

Thank you,
Alessandro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top