Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(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.

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)
    }
}