Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Arthur Scott's Devlog

A topic by Arthur Scott created Dec 20, 2015 Views: 1,833 Replies: 14
Viewing posts 1 to 12
Submitted

Right so, had a thought shower last night and came up with some ideas. Life in Space is a good theme, and with Tim Peake in the news a lot at the moment, I wanted to create something with the ISS in it.

I often struggle with creating fully fleshed out ideas so I wanted to get a fair amount sorted up front.

A game isn't really a game until it has play/win/lose states...


So my idea is thus:

The International Space Station is floating through space, constantly orbiting the Earth, in its path is a load of space junk! Your mission is to clear the path for the ISS. Hence:

Space Sweeper

The ISS has a laser cannon mounted on it to clear debris, which you can control with the keyboard. Also you'll need to send out intrepid astronauts to collect fuel/power ups/special treats, you'll control them with the mouse.

If the ISS takes too much damage, or all your astronauts are killed, game over.

Score based, with increasing difficulty levels - more junk!

I've created a GitHub repo : https://github.com/artSturgeon/spacesweeper, but there isn't much in there yet.

I'll be using Kotlin and Ashley, so first task is to set up Gradle/IntelliJ for Kotlin compilation, and get a couple basic systems in there. Then I'll use Inkscape to create some initial mock ups and basic graphics.

I'll be tweeting progress : @art_sturgeon

And posting here, and on my website : houseofsturgeon.org

Thanks for listening!

art

Submitted

Ok, end of day two. Got some basic Ashley components and systems up and running. Made some (very) basic graphics in Inkscape. Put the two together...

And then spent ages fighting with maths trying to get bullets to fire from the right location...managed to make a pretty bullet hell pattern in the meantime though.

Finally got it working, added in a FiringSystem with a spawn timer, all is good.

Next need to add some pooling, I'm creating too many Entities!

Then onto collisions I reckon.


I got stuck with some Kotlin code earlier, and got some really great help from the Kotlin slack channel. I'm impressed with the community that's built up around Kotlin already, and in its uptake in the Java world in general, as is evidenced by this game jam!

Submitted (1 edit)


Had a good bit of time to spend on my jam entry today, made some decent progress.


Now have basic collisions, plus a title screen, and a star field!


Starfield!


Really enjoying working with Ashley, once there are a few systems in adding new entities is really easy!


Also added in Aurelien Ribon's Universal Tween Engine, time to get Easing!


Also must work out how to embed images/gifs into a post!

(1 edit)

Just click the "<>" button to enable html, and then: <img src="{image_uri}" />


Nice starfield btw. I'm looking into a good way to do this without having to use a static image resource and hopefully draw them programatically.

Submitted

Ah thanks!

The starfield is a single star image, added every x seconds with random scale and velocity :

package org.sturgeon.sweeper.systems

import com.badlogic.ashley.core.Entity
import com.badlogic.ashley.systems.IntervalSystem
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.math.MathUtils
import org.sturgeon.sweeper.Assets
import org.sturgeon.sweeper.components.BoundsCheckComponent
import org.sturgeon.sweeper.components.MovementComponent
import org.sturgeon.sweeper.components.PositionComponent
import org.sturgeon.sweeper.components.VisualComponent


class StarfieldSystem(var i:Float) : IntervalSystem(i) {
    
    override fun updateInterval() {
        var star = Entity()

        var t = Texture(Assets.STAR)

        var pc = PositionComponent(Assets.VIEWPORT_WIDTH+100,
                MathUtils.random(0f, Assets.VIEWPORT_HEIGHT),
                t.width.toFloat(), t.height.toFloat())

        var scale = MathUtils.random(0.1f, 1.2f)
        pc.scaleX = scale
        pc.scaleY = scale

        star.add(pc)

        star.add(VisualComponent(t, 0))
        star.add(MovementComponent(MathUtils.random(-300f, -100f), 0f))
        star.add(BoundsCheckComponent())

        engine.addEntity(star)
    }
}
Submitted

Spent a bit more time pottering with yon jam entry.

I now have a pretty good vertical slice of a game:

Start screen -> playing screen (with score and health) -> Game over screen

While all the parts are relatively basic, it means that even if I were to release now, there's kind of a game in there (albeit not a very good one). A minimum viable product if you will.

Now it's a case of adding features, and polishing what's currently there.

Applying Agile software principles to game development, oh yes.

Submitted (4 edits)

Now got me some breaking up asteroids:


Submitted

Added angular velocity to my movement/position systems

And the world turns!

Title screen actually looking like a title screen now, time to polish up the graphics I reckon.

Submitted

Sometimes I find the interop between Kotlin and libGDX (Java really) a bit odd, but when it comes together, it really does make for a lot less boilerplate:

var firing = Texture(Assets.TURRET_ANIMATION)
var tmp = TextureRegion.split(firing, firing.width, firing.height/10)
var firingFrames = Array<TextureRegion>(10, { i -> tmp[i][0] })
var firingAnimation = Animation(0.02f, *firingFrames)

testAnim.add(AnimationComponent(firingAnimation))


Here I'm trying out animations using a sprite sheet. This works in this instance because I only have one column in the sheet, hence mapping it straight into a 1 dimensional array.

I struggled a little with the Animation constructor because I thought I needed a badlogic.Array, I had a Kotlin array and couldn't get them to play nice together. Turns out Animation will take a varargs TextureRegion as argument which Kotlin's spread (*) operator will let us do from an Array.

Neato!

Submitted

So after a good initial start, I'm now at the point where everything is broken and horrible....yack...

I've been having problems with animation, and graphics. I'm not great at graphics work, but I'm giving it a go.

I'd decided to use Spriter Pro for animations, as I have a license for it and it gives me an excuse to try it, but I'm finding it a bit...dodgy...

I use Inkscape for all my graphic work, export as separate png's, import into Spriter, animate, export as sprite sheet png, import into libGDX and create an Animation. However Spriter seems to really mess up the image quality. I'm now exporting from Inkscape at 4 times the resolution I need, then scaling the final sprite sheet down in Gimp before importing into libGDX.

The other thing that bugs me is that Spriter doesn't seem to allow for any snapping/alignment, so everything is done by eye.

I only need pretty simple stuff, here's an example gif:



Either I'm missing something in Spriter, or I'm going about this the wrong way...

What does anyone else use for creating animations? Especially using graphics created in Inkscape ?

Submitted

So I'm sticking with Spriter for now, and I'm done with the turret animation, spent way too much time on that...

Picked a nice new font though, and made a new logo:

Next I'm going to work on transitions between scenes, title to playing etc. Also started making some musics, using Caustic on Android.

Submitted

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)

Submitted

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...

Submitted

Right, reckon I'm functionally complete now, time for a function freeze!

Should still have time to tidy up some of the graphics a bit more, and then balance gameplay.

The only thing I'm still not sure about is control, at the minute the turret/firing is keyboard controlled, the astronaut is mouse controlled. Which makes it a bit awkward...I was thinking of moving firing to the mouse, but I'd have to track the cursor with the turret which would probably make things too easy...will try and find a willing victim to try it out for me...

Probably won't have time to add in music though, not to worry, that was always last on the list.

Submitted

Right I reckon that's it. I'm away at the weekend so I won't be able to do any more work then.


One last test of everything and then I'll release.

I'm relatively pleased with it, learnt a lot of new stuff, had fun taking part, so all good. Fingers crossed it doesn't just crash on other peoples machines!