Someone recently asked... (2d game dev in JME)

Recently, someone had asked about a comparison between JME and a few other engines (mostly 2d focused… libgdx, slick2d, etc)

So, I started kicking around a 2d framework for JME. The idea basically takes the approach these other engines do for rendering (single quad, transform a bunch on CPU, render, move to next object) and throws it out the window, because you can’t do this in JME.

Instead, I allow the user to create a single mesh and track/apply transforms/run animations against each “quad” within the mesh. Each quad has an origin, rotation, scale (x and y), and location… these can be linked to another quad (i.e. parent that effects transform chain). Each has a bucket for interpolation based animations that it applies, etc, etc.

There is the drawback of having to perform the transforms on CPU, however… it is not as much of a gut punch as how it is done in these other libraries.

In their case: each time you render, it performs the transform against the single quad local to the CPU > pushes updated verts to GPU, renders.

In this case, it performs all transforms against all mesh owned “quads”, pushes to GPU, renders.

Anyways, here be an example of what it can do (or some of what it can do). The buggy is a single mesh, with parent linkage, running a series of interpolation based animations:

[video]http://youtu.be/sNgkOpHG0YY[/video]

3 Likes