Creating a 4k game - Where to start?

I have looked around a bit and found some examples in the threads, for example the Pengo4k thread has some code in it. I still thought that I would ask if there is any tutorial which explains some tricks and development strategies created by one of you guys?

Are the way used in Pengo4 the preferred way? A small example where you can control a square or something built using the tricks that you normally use in this situation would be great.

I’m not new to programming but I’m not good at game programming in general and using Java in particular. Still it would be fun to join and I think that it’s entierly possible if I just got some pointers to begin with. Also, should this thread have been created in the competition forum? It seemed so “nice and clean” that I didn’t want to clutter up the forum with this post, my humble apology if I was wrong in doing so.

there are some tricks in this posts

There are lots of tricks all over the forums, posted after 4k 2005 contest a search will reveal most of them.

but generaly, write clean and neat java, make it do what you want it to do, and then sqash it to the minimum (for example inlining ALL methos into run() or into the constructor) and use the tricks after finishing it.

-one class
-as few methods as possible
-as few class variables as possible (move them to the constructor)
-use obfuscators (progruard, jax, jarg, joga…) in different combinations (eg jax->jarg or joga->jarg)
-try different zip programs (7zip/kzip)
-?: is smaller than if/else
-decompile your stuff occassionaly to check if the obfuscators do their job
-use enableEvents instead of listeners
-look around in the lib for stuff you can (ab)use

Even more info:

http://wiki.java.net/bin/view/Games/4KGamesDesign

Thanks for your replies! Especially the Wiki was a great read, can’t wait for the Sound section to be finished! hint

I’ve begun creating a game now, started out with directly inheriting from JFrame but I moved to an applet structure. I have some ideas for semi-procedural graphics which might look neat. We will see. :slight_smile: