Search code examples
javaappletjava-web-start

How to learn game development?


I've been a web programmer for a while and I can also program in Java. I have an idea for a small, multiplayer RPG game that I want to work on. It will be played through a java applet in the user's web browser.

I have written the design document and specifications of the gameplay. What I'd like to know now is how I can develop the game? I've worked only with windows-like business apps in the past, with built-in widgets for textboxes, dropdowns, etc. With game programming it seems that I would have to build my own widget/controls for the UI of the game.

These are the specific questions I have in mind:

1) How to display a 'loading...' message with a progress bar while the game's images, sound, etc are being downloaded. (Using the java applet)

2) How to create the UI of the game with its own menu, controls, etc. Such as by clicking the map icon it would show up a map to them. Clicking the friends icon would let them chat to their friends, etc.

3) And other, general game development issues that i should know about, like whether I should use 2D or 3D graphics, physics in games, etc.

If there's a good recommendation for a book that will help me, do share.


Solution

    1. The easiest route is to package everything in a Jar file. The default screen does show a progress bar with some small ability to customise. You can write custom code to keep track, manage and download files but I would personally advise against this route. If you search for applet loaders you will find more information.

    2. I'm not 100% sure what you mean, but you can use Swing components in the same way you can use them in applications. Use a JButton with an image is quite trivial, then hook the event code in the actionPerformed method.

    3. The biggest problem you will probably come across is animation and the EDT. I asked about this earlier.

    This page has a whole bunch of useful links for game development. Pulp core is an open source framework worth checking out - even if you don't use the framework you can investigate the code.

    Whether you should use Java applets or not seems out of scope of this question, but a lot of the above answers give objective (or no reasons at all) about whether to use Java applets. If it's a game for a personal exercise to learn Java then it's a great approach. If you wish to make it public you need to consider whether the current adoption levels are high enough for your needs.

    Things have changed in the applet world recently. Since 1.6 update 10 it is much more competitive with Flash - the download size is smaller (at typically under 4Mb), the startup time is reduced and a new scaling look and feel was introduced.