I am creating an iPhone game using cocos2d + box2d that needs a lot of levels. My friends and I are creating the game and most of them have no programming experience and end up with nothing to do. I want to make a level creator / editor java applet that can create a level file and then I can parse that file into a box2d level with objective-c

The only problem is that I have never done game programming with java so I'm not sure where to start. I want to create something like this level editor video and let the user add predefined shapes like circles and boxes.

I can do all the objective-c side of things so I just need help with the java side

Any advice? Thanks

| improve this question | | | | |
  • \$\begingroup\$ If you're comfortable writing Objective-C, why not coding your level editor with it? \$\endgroup\$ – Laurent Couvidou Apr 16 '12 at 22:43
  • \$\begingroup\$ because none of my friends have macs. I know java well but I have never done game development in it \$\endgroup\$ – GeeGoldz Apr 16 '12 at 22:57
  • \$\begingroup\$ This is a really broad question. Can you not use something off the shelf? gamedev.stackexchange.com/questions/8600/… \$\endgroup\$ – Tetrad Apr 16 '12 at 23:00
  • \$\begingroup\$ I can't use something off the shelf because once the game is released, I want other people besides my friends to be able to make the levels specifically for my game. Sorry for the question being too broad, but I want something similar to the happy wheels level creator \$\endgroup\$ – GeeGoldz Apr 16 '12 at 23:05
  • \$\begingroup\$ Did you think about using Adobe AIR (Actionscript) instead? It also allows you to create a desktop application for Mac/PC/Linux and writing visually oriented stuff like Editors is rather simple using Flash/Flex. \$\endgroup\$ – bummzack Apr 17 '12 at 6:30

Since your game is written in objective-c and you have decided to use Java for the level editor, I assume that the level editor doesn't need to render the levels exactly as the game engine.

I have written many level editors for commercial mobile games with Java, and I can strongly recommend using Java2D, which is part of Java. If you don't need 3D graphics and the editor is not performance critical, you can get things done easily with Java2D. It is a strong 2D graphics library with features such as arbitrary shapes, Constructive Area Geometry, antialiasing, strokes, affine transformations, text rendering, arbitrary clipping and alpha blending. I have found these very useful when creating user interfaces for level editors. E.g. good looking marching ants is easy to implement for arbitrary selection shape. Images can be zoomed and rotated with filtering and there is no need to allocate textures, instead Java2D automatically uses hardware acceleration where possible.

You can also use Swing for creating some of the UI. Menus, toolbars, object choosers, dialogs can be implemented with Swing components with little effort and you can use Java2D inside them wherever you want.

These choices are good when making Java applets, since they don't require any native libraries outside JRE or additional downloadables.

| improve this answer | | | | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.