1 Reply Latest reply on Oct 24, 2011 9:45 PM by gimbal2

    J2ME game project advice

      Hey guys, i was hoping to get some advice on a project i am about to start. basically I have just started learning J2ME, using Netbeans. i have went through few tutorials from Hello World to Pong and completed them working fully. Now my project is something not too difficult I hope what i wanted to do was create a dungeons and dragons type game.

      Basically I see my game as a start screen, the user presses start and then the player enters a castle and then there are either 1-4 doors available to walk into one on each side of the screen, the bottom door will always be to take the player to the previous screen.

      I have just started the project, but before I even enter any code i was hoping I could get some advice form you guys first. IN each room I hope to have things for teh player to interact with, wether it is a treasure chest, dragon, another human or traps, I have not decided yet.

      I was thinking of having a class one for each screen, but many screens means many classes. I am not even sure how to start with the titlescreen as i am completely new to J2ME.

      any help would greatly appreciated!

        • 1. Re: J2ME game project advice
          I was thinking of having a class one for each screen, but many screens means many classes. I am not even sure how to start with the titlescreen as i am completely new to J2ME.
          No, that is not what you want. Like you should always do in programming, do-not-start-with-the-code. Very bad practice!

          Start with a piece of paper and draw some simple screen designs. Menu, in game screen, control widgets, etc. Get something visual going quickly.

          Next, Use some proper non-programming related terms to describe the game and stick to them. You do not have screens, you have rooms. Each room has doors in its walls which leads to another room. All the rooms together form a maze. Each room has different properties. It can have 1-4 doors, it might hold an item, a trap, an enemy, etc.

          Given from the short description I have given you, you should already be able to distill a simple design. You can already easily identify two main classes: Maze and Room. A Maze consists of rooms. Each room links to 1-4 other rooms through a door. Each room has zero or more elements in it which are different from room to room. You will want to be able to control per room what it contains. I smell a simple grid based data structure; but then you still need a way to actually create the data for the game. There are two basic options: create a level editor, or auto-generate the mazes based on some simple rules. The latter would be the best choice in this case, as you get endless levels. The former has the benefit of having precise control over the design and difficultly of a maze.

          Auto generated levels become more difficult when you want to add an option to save progress though, as you'd need to be able to not only recreate the level (hint: generate based on a seed) but also restore the progress that the player made in that level. Its up to you really.

          When you have your game fleshed out, its time to start taking the technology into account. You'll have a nice set of functional and technical requirements that you need to fulfill; a good resource on J2ME game programming will probably help you to fulfill most of them. Don't expect to just be able to do this, you'll need to study J2ME a lot and probably do a whole set of test and play programs before to figure out how to do even the simplest things. I recommend you get a good book in stead of trying to piece it together using the internet, in moments like this you need something coherent in stead of something as fragmented as the web.