Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Been playing around with things a bit, before adding new features.

I've always wanted to make a game which had really big text scrolling along in the background, probably influenced by Jeff Minter or someone I think.

So I added a new system to do just that:

class BigTextSystem(i:Float) : IntervalSystem(i) {
    override fun updateInterval() {
        if (MathUtils.random(1,100) < 25) {
            engine.addEntity(Entity().apply {
                add(PositionComponent(Assets.VIEWPORT_WIDTH, 500f))
                add(MovementComponent(-850f, 0f))
                var msg = Assets.SOME_TEXT.get(MathUtils.random(0, Assets.SOME_TEXT.size - 1))
                add(TextComponent(msg).apply {
                    scale = 16.0f
                    colour = Color(223 / 255f, 113 / 255f, 38 / 255f, 0.75f)
                    front = false
                })
                add(BoundsCheckComponent(8000f))
            })
        }
    }
}

Also I've just discovered Kotlin's 'apply' function, as you can probably tell...


Here's a screenshot (it looks better in motion)

Been a while since I posted an update here....

Haven't been able to work on my game as much as I would have liked over the last week or so, life type things getting in the way I guess. Anyway, I'm still going, focusing on trying to get all the functionality in this weekend, then spend next week bug fixing and polishing, hopefully tidying up some of the crappy graphics.

It's gotten to the point now where the code is starting to get a bit crufty, started out with great intentions as always but along the way little hacks and things creep in. Have a few unused components and systems, guess they aren't really doing any harm though.

I have had to do some refactoring though, my poor astronaut just wasn't behaving himself.

I'm pretty new to Ashley and ECS systems in general, one of the things I don't think I've got right yet is interaction between different entities, mostly in response to events.

So I have a great big 'World' class which is the actual play screen, which has the listeners for keys (but not mouse, that ended up somewhere else??), and sets up the state, adding in entities etc. This is where I've been putting callbacks when things happen, but I'm never sure where to direct those callbacks...I don't have Entity classes as such, I just create them as and when needed...and it doesn't seem right to put that logic into the System classes...so it all ends up in this big (and getting bigger) class...I managed to take some of it out and create a Station class for the space station and its different entities and have been moving some of the functionality into here, but it still doesn't seem quite right.

Once I'm finished I'll have to go and check out everyone elses source code and see how they're doing it...