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
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