N.O.A.H.
We have had relatives over for a while (and they're still here) but I've found a spare hour or two where I can think about this. I've decided to go for a game similar to Defender in concept, but the roles are reversed in that you play the alien. It's called "N.O.A.H." for Near Orbit Alien Harvester. Controls will probably be Lunar Lander style, at least for the vertical component. The player will be given quotas of particular animals to collect from Earth, but of course the humans won't take too kindly to that and will no doubt defend themselves vigorously.
I am using Ashley as Entity Component Systems are reminiscent of how we used to write games in the olden days, when would cajole performance out of 1.77MHz Z80 processors on computers with less RAM than is required for one line of pixels on my phone. No wonder the T-1000 used a 6502.
It would appear that I'm not the only one who has tried to use Kotlin, LibGDX and Ashley. This is good, because I don't have to spend hours trawling for simple fixes to things that I just don't know about yet. Admittedly it's a little out of date, but still…
At first glance Kotlin's data classes seem to be a good candidate for implementing Components.
e.g.,
data class TransformComponent(var x: Float, var y: Float) : Component
But then again, it's also fine without being a data class. Either way, I love how it can be done in one line. It did cause me a little difficulty with Family.all() until I found that I had to use TransformComponent::class.java rather than TransformComponent.class.
Progress in the last couple of hours:
- Implemented a simple RenderSystem, derived from IteratingSystem, overriding update() to bookend the drawing calls with spritebatch begin() and end().
- Learned about Kotlin's xxx::class.java.
- Learned about Kotlin's .forEach() but ultimately didn't use it.
- Created a RenderableComponent.
- Created a TransformComponent. Again, I love how this can be done in one line.
- Added a couple of entities just to prove that everything works.
- Accidentally typed a semi-colon just once.
Still no game, but I know where I'm going with this and I like the idea - always a good sign.