× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Pattern Oriented Game Programming with the Java Marte Engine

Andy Maleh
May 08, 2015
<p>Game programming has come a long way since the early Java 2D and Java 3D OpenGL based APIs.  A recent engine developed by a group of 3 developers, Alberto Martinelli from Random Towers, Thomas Haaks from Right Angle Games, and Stefan (Stef569), is aspiring to bring clean-code object-oriented design-pattern-based approaches to game development in Java using the LWGJL (Light Weight Game Java Library) and Slick2D library.</p> <p>I helped a fellow named John today get through a TankGame project taking full advantage of the MarteEngine, and the experience was a day and night difference from the unapproachable early Java 2D and Java 3D days.</p> <p>The project code took advantage of many Design Patterns, such as State, Observer, Iterator, Mediator; Architectural Patterns, such as MVC, and heavy Object-Oriented techniques relying on polymorphism, inheritance, balancing of coupling and cohesion, and proper domain modeling.</p> <p>The Marte Engine made all of that possible by distilling game programming work into a handful concepts, and providing all the library tooling around them:</p> <ul> <li>Game environments are represented by World objects, including levels and stages</li> <li>Game elements are represented by Entity objects, including players, enemies, and obstacles</li> <li>Game logic is represented by World or Entity update events <ul> <li>Events can be defined with meaningful names and assigned to keyboard or mouse triggers (left, up, click)</li> <li>Events are handled in a decoupled fashion by relying on their defined meaningful names</li> </ul> </li> <li>Game graphics are programmed with World and Entity rendering events decoupled from logic update events</li> <li>Finally, game screen/mode changes are handled with game State objects </li> </ul> <p>This is how the most fundamental state-based games are programmed with the Marte Engine on top of LWGJL and Slick2D.</p> <p>I highly advise all Enterprise Java programmers to take a look. It barely looks different from business programming with all the object orientation and design patterns involved.</p> <p>Java has apparently, very gradually, changed the face of multi-device game programming forever!</p>
comments powered by Disqus