Cool to see that JGO has become relatively active again. Last I was around here, things were looking quite dead.
I know most people roll with OpenGL and 3D for game development, but if there are any here who don’t, I released the MicaByte “Game Library” as open-source some time ago. It’s available on Github. It’s licensed under Apache 2.0.
It’s essentially a collection of convenience classes that encapsulates some of the commong functionality that I’ve found useful while working on my games; an ImageHandler (WeakReference based cache), StringHandler (I do very text heavy games), a very simple MusicHandler, and a fairly complex SurfaceView implementation that handles HUGE images (I’ve tested up to 10Kx10K pixel bitmaps), and supports scrolling, fling and pinch-zoom on them. There’s also the beginnings of renders to support tile maps (both hex and square based).
None of the code is either terrible original, or even very complicated. Most of it is either trivially simple, or stuff I picked up the ideas for around on the web. So I figured that if other can benefit from looking at my code (or even improve it), that alone is worth the effort of cleaning it up and putting it online. Also, I work with open-source for a living, so it’s sort of in my DNA these days to just put code out there.
The code base is a bit dirty at the moment, as I’ve just recently moved things to Android Studio/Gradle and am still refining the libraries, but I plan to clean up the code and the example project in the coming months.
Why Android Canvas?
I work almost entirely in Java Android. That’s mostly a convenience thing – the time I have for game development is very limited, so I try to keep things as simple as possible in my “hobby” work. And say what you will about Android, but it’s extremely easy to work with. As I recall, it took me a few weekends to create my first fully functioning Android game back in the day. It doesn’t get much simpler than that.
There’s another thing that keeps me sticking to Android of course, which is that I hate GUI and graphics programming. I’d just much rather spend my time working on the things that I find interesting: the game design, the game engine and the artificial intelligence. GUI and graphics are the dreary chore that I need to do in order to do justice to the rest. One of the things that I like about the Android framework is that it makes creating and editing flexible GUIs very easy. Very useful, if you - like me - create games with text heavy UIs and lots of tables and options.
Unfortunately, pretty much every game library for Android (and I’ve looked at most) aims for cross-platform compatibility, and in the process essentially end ripping out pretty much everything good about Android. They also tend to focus on full-screen arcade/action game functionality, which tends to be less than useful when you need impart lots of information and display large maps. I played around a bit with libGDX back when it still supported embedding within Android views, but now (or at least last I checked), that functionality is gone (understandable - but unfortunate from the POV of my requirements). If there is something better and easier than native Android for doing simple strategy games in Android, then I certainly haven’t found it yet.
I based it on the Android Canvas, because this was the easiest for me to do at the time. I’ve looked into re-implementing the 2D functionality using OpenGL a couple of times, but ultimately, the effort just hasn’t felt worth it from my POV. as - so far - the performance of the Android Canvas has been sufficient for my needs.
Anyway; posting this here in case this is of use. I enjoy discussing with others who are into developing strategy games/tactical RPGs (which is what I’m using this code for), so if you should happen to find the library useful, do let me know.