LWJGL is the game engine behind Minecraft, a fact I consider pretty cool but what makes it this months sub-zero find its that it is pretty easy to learn and use. It makes sense and the notes of the web seem to actually work!! Here are some helpful notes on using the LWJGL for game development that I documented during my own learning process. It also used the OpenGL libraries so its worth noting their documentation location.
INSTALLATION AND SETTING UP
LWJGL is pretty good at working with many platforms and not needing a separate installation (a good thing in schools) . First thing is to download the latest version and then look at how to setup LWJGL in Netbeans.
However, these things I have learnt…
- Textures/Sprites must be a factor of two e.g. 8, 16, 32, 64 otherwise weird stuff happens.
- OpenGameArt provides a useful source of game sprites for the lazy. Also consider open.commonly.cc
- My textures were appearing upside down because my screen coordinates started in the bottom left corner (not conventional) so I had to change the two instances of gluOrtho2D to gluOrtho2D(0.0f, DISPLAY_WIDTH, DISPLAY_HEIGHT,0.0f); so they listed the corners in the order of left,right,bottom,top. Also sprites should be draw in the order of TL, TR, BR and lastly BL.
Thinking about Sensor Lines.
If you start to read the articles on Sonic you will read about Sensor Lines, which confused me for a while, so I drew this.