I was just wondering if it’s possible to make a 2D game with JME3 yet? I’ve looked around this forum for the answers to this question and their dating waaay back to 2012 (or earlier) and say to attach everything to the guiNode. My issue with that is that they also say it’s bad practice to do that as that node is responsible for the GUI only.
I’ve tried the likes of LibGDX but found it too clunky or confusing to use. Whereas I prefer JME3 as the was it’s set out is extremely beautiful and easy to use.
If it is possible how could I do it?
Mainly what I need to do is just get an animated sprite to walk around with two images on a tile map. One way I could probably do it is to use a particle, but that just seems wrong to me. Anyone else have any ideas?
I made an Android game some months ago and released it on play store. Here’s link if you want to give it a try and see how JME is working for 2d games: [ARCADE] [ANDROID] Karma Siege
If you don’t want to attach everything to guiNode you can maybe write a class that acts like a proxy from 2d to 3d,transforming your 2d coordinates into a Vector3f that’s suitable to be used as a local translation,and attach everything to rootNode. However,this is a bit tricky and you have to transform coordinates really precisely or you can have some issues with things like click events.
I’ve always just made my own controls for the spatials which only lets them move in 2 dimensions. You WILL hit draw order problems which you will need to sort out if you are using textured sprites, as the 3d engine will draw through each other and you will get z-fighting. You should be able to fix this by offsetting the objects on the camera axis. It’s also important to note that it will be difficult to get pixel-perfect sprites to appear on screen correctly as by default jmonkey uses floats and 3d objects. None of this is impossible to overcome, just things to be aware of.
Except the issue I’m having at the moment is this:
I want to make say a sprite man. - This is the simple bit I know.
When the player presses any direction, the sprite changes:
left and right - when left the sprite image flips and changes between a static sprite and a “walking” sprite, ditto with right but the sprite can be flipped to original facing.
up and down - again this is kinda simple, when up the sprite is showing the “back” of the man sprite which has a static image and a single walking image. ditto for going down, which is simple as it just involves changing the sprite to the front sprite.