<file_sep>package net.jorhlok.shootyshoot

import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister

/**
 * Created by joshm on 6/15/2017.
 */
class Door(MGR: MultiGfxRegister, MAR: MultiAudioRegister) : SSEntity(MGR, MAR) {
    companion object {val TileNum = 33; val TypeName = "Door"}
    init {
        Type = Door.TypeName
        CollEntities = true
        CollEntWhite = emptySet()
        AABB.set(0f,0f,1f,1f)
    }
    override fun draw(deltatime: Float) {
        MGR.drawRgb("_door",0f,Position.x+0.5f,Position.y+0.5f)
    }
}<file_sep>package net.jorhlok.shootyshoot

import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister
import net.jorhlok.oops.Entity

/**
 * Created by joshm on 6/15/2017.
 */
abstract class SSEntity(
        var MGR: MultiGfxRegister,
        var MAR: MultiAudioRegister) : Entity()  {
    companion object {
        open fun getId() = 0
    }
}<file_sep>package net.jorhlok.shootyshoot

import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister

/**
 * Created by joshm on 6/15/2017.
 */
class Pedestal(MGR: MultiGfxRegister, MAR: MultiAudioRegister) : SSEntity(MGR, MAR) {
    companion object {val TileNum = 34}
    override fun draw(deltatime: Float) {
        MGR.drawRgb("_pedestal",0f,Position.x+0.5f,Position.y+0.5f)
    }
}<file_sep>package net.jorhlok.shootyshoot

import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.maps.tiled.TiledMapTileLayer
import com.badlogic.gdx.math.Rectangle
import net.jorhlok.multiav.MTrack
import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister
import net.jorhlok.oops.DungeonMaster
import net.jorhlok.oops.LabelledObject

class TestDM(mapname: String,
             var MGR: MultiGfxRegister,
             var MAR: MultiAudioRegister) : DungeonMaster(mapname) {

    var muz: MTrack? = null

    var cam = OrthographicCamera()
    var cambounds = Rectangle()
    var statetime = 0f
    var Player: TestPlatformer? = null
    var enter = true

    override fun begin() {
        val LyrTileObj = Level!!.layers["TileObjects"] as TiledMapTileLayer?
        if (LyrTileObj != null) for (y in 0..LyrTileObj.height-1)
            for (x in 0..LyrTileObj.width-1) {
                val obj = LyrTileObj.getCell(x,y)
                if (obj != null && obj.tile != null) when (obj.tile.id) {
                    //71 black box
                    //72 moving
                    Door.TileNum -> {
                        val o = Door(MGR,MAR)
                        o.Position.set(x.toFloat(),y.toFloat())
                        Living.add(o)
                    }
                    Pedestal.TileNum -> {
                        val o = Pedestal(MGR,MAR)
                        o.Position.set(x.toFloat(),y.toFloat())
                        Living.add(o)
                    }
                    Alchemy.TileNum -> {
                        val o = Alchemy(MGR,MAR)
                        o.Position.set(x.toFloat(),y.toFloat())
                        Living.add(o)
                    }
                    ThruPlat.TileNum -> {
                        val o = ThruPlat(MGR,MAR)
                        o.Position.set(x.toFloat(),y.toFloat())
                        Living.add(o)
                    }
                    49 -> Living.add(Collectible("_mineral",x.toFloat(),y.toFloat(),MGR,MAR))
                    50 -> Living.add(Collectible("_herb",x.toFloat(),y.toFloat(),MGR,MAR))
                    51 -> Living.add(Collectible("_eyeball",x.toFloat(),y.toFloat(),MGR,MAR))
                    52 -> Living.add(Collectible("_worm",x.toFloat(),y.toFloat(),MGR,MAR))
                    53 -> Living.add(Collectible("_dollar",x.toFloat(),y.toFloat(),MGR,MAR))
                    54 -> Living.add(Collectible("_potion",x.toFloat(),y.toFloat(),MGR,MAR))
                }
            }

        MGR.camera.setToOrtho(false,640f,360f)
        MGR.updateCam()
        MGR.setBufScalar("main",1/16f)
        cam = MGR.getBufCam("main")!!
        cam.setToOrtho(false,640/16f,360/16f)
        cambounds.set(320/16f,180/16f,LyrTerrain!!.width-640/16f,LyrTerrain!!.height-360/16f)

        MAR.setMusVolume(0.125f)
        MAR.setSFXVolume(0.25f)
        muz = MAR.getMus("frcasio")
        muz?.Generate()
        muz?.play(true)

        Player = TestPlatformer(this,MGR,MAR)
        Player!!.Parent = this
        Player!!.Name = "Player"
        Living.add(Player!!)
    }

    override fun end() {
        muz?.stop()
        muz?.dispose()
        Living.clear()
        Player = null
    }

    override fun prestep(deltatime: Float) {
        if (Gdx.input.isKeyPressed(Input.Keys.ENTER)) {
            if (enter == false) ScriptLaunch = "pause"
            enter = true
        } else enter = false
        if (Gdx.input.isKeyPressed(Input.Keys.SPACE) || Gdx.input.isKeyPressed(Input.Keys.UP)
                || Gdx.input.isKeyPressed(Input.Keys.W))
            Player!!.Mailbox.add(LabelledObject("CtrlJump",true))
        else
            Player!!.Mailbox.add(LabelledObject("CtrlJump",false))

        if (Gdx.input.isKeyPressed(Input.Keys.RIGHT) || Gdx.input.isKeyPressed(Input.Keys.D))
            Player!!.Mailbox.add(LabelledObject("CtrlRt",true))
        else
            Player!!.Mailbox.add(LabelledObject("CtrlRt",false))

        if (Gdx.input.isKeyPressed(Input.Keys.LEFT) || Gdx.input.isKeyPressed(Input.Keys.A))
            Player!!.Mailbox.add(LabelledObject("CtrlLf",true))
        else
            Player!!.Mailbox.add(LabelledObject("CtrlLf",false))

        if (Gdx.input.isKeyPressed(Input.Keys.DOWN) || Gdx.input.isKeyPressed(Input.Keys.S))
            Player!!.Mailbox.add(LabelledObject("CtrlDn",true))
        else
            Player!!.Mailbox.add(LabelledObject("CtrlDn",false))
    }

    override fun draw(deltatime: Float) {
        statetime += deltatime

        cam.position.set(keepPointInBox(Player!!.Position.cpy().add(0.5f,0.5f),cambounds),0f)

        cam.update()

        MGR.startBuffer("main")
//        MGR.clear(0.1f,0.1f,0.1f,1f)
        MGR.clear(0f,1f,1f,1f)
        MGR.drawTileLayer(LyrTerrain!!,"sprites",1f,statetime)
        for (e in Living) {
            e.draw(deltatime)
        }
        MGR.stopBuffer()
//        MGR.drawBuffer("main")
//        MGR.flush()
    }

    override fun flip() {
        MGR.drawBuffer("main")
        MGR.flush()
    }

    override fun pause() {
        muz?.stop()
        muz?.dispose()
    }

    override fun unpause() {
        val quitting = Parent!!.GlobalData["quitting"]
        if (quitting != null && quitting.label != "") ScriptStop = true
        muz?.Generate()
        muz?.play(true)
        MGR.camera.setToOrtho(false,640f,360f)
        MGR.updateCam()
        MGR.setBufScalar("main",1/16f)
        cam = MGR.getBufCam("main")!!
        cam.setToOrtho(false,640/16f,360/16f)
    }

    override fun clone() = TestDM(MapName,MGR,MAR)
}
<file_sep>package net.jorhlok.shootyshoot

import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import com.badlogic.gdx.math.Vector2
import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister
import net.jorhlok.oops.DungeonMaster
import net.jorhlok.oops.LabelledObject

/**
 * Created by joshm on 7/20/2017.
 */
class PauseDM(var mapname: String,
              var MGR: MultiGfxRegister,
              var MAR: MultiAudioRegister) : DungeonMaster(mapname) {

    var enter = true
    var x = 0f
    var y = 0f

    override fun begin() {
        val cam = MGR.getBufCam("main")
        if (cam != null) {
            x = cam.position.x
            y = cam.position.y
        }
    }

    override fun prestep(deltatime: Float) {
        if (Gdx.input.isKeyPressed(Input.Keys.ESCAPE)) {
            Parent!!.GlobalData.put("quitting", LabelledObject("y"))
            ScriptStop = true
        }
        if (Gdx.input.isKeyPressed(Input.Keys.ENTER)) {
            if (!enter) ScriptStop = true
        }
        else enter = false
    }

    override fun draw(deltatime: Float) {
        Parent!!.drawPrevious(deltatime)
        MGR.startBuffer("main")
        MGR.drawString("libmono","PAUSE",x,y)
        MGR.stopBuffer()
    }

    override fun flip() {
        MGR.drawBuffer("main")
        MGR.flush()
    }

    override fun clone() = PauseDM(mapname, MGR,MAR)
}<file_sep># ShootyShoot
Small game, possibly.

jorhlok.net
<file_sep>package net.jorhlok.shootyshoot

import com.badlogic.gdx.math.Vector2
import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister
import net.jorhlok.oops.Entity

class TestPlatformer(val DM: TestDM, MGR: MultiGfxRegister, MAR: MultiAudioRegister) : SSEntity(MGR, MAR) {
    var Gravity = Vector2(0f, -24f)
    var Grounded = false
    var JumpVelo = 12f
    var WalkVelo = 16f
    var WalkAccl = 16f

    var jump = false
    var left = false
    var right = false
    var drawdir = false
    var forcefall = false

    var wobbletime = 0f
    val wobbledepth = 20f
    val wobbleperiod = 0.25f

    val tolup = 0.5f/10f
    val toldn = 0.5f/10f

    init {
        AABB.set(3/16f, 0f, 10/16f, 14/16f)
        Tolerance.set(2/10f, 10/14f)
        Position.set(5f, 8f)
        Friction.set(16f,0f)
        Physics = true
        CollTiles = true
        CollEntities = true
        val ceg = HashSet<String>()
        val ceat = HashSet<String>()
        ceat.add(ThruPlat.TypeName)
        CollEntAsTile = ceat
        ceg.add(ThruPlat.TypeName)
        ceg.add(Door.TypeName)
        CollEntGray = ceg
        Type = "TestPlatformer"
    }

    override fun prestep(deltatime: Float) {

        Velocity.add(Gravity.cpy().scl(deltatime))

        for (p in Mailbox) {
            if (p.label.startsWith("Ctrl")) {
                val b = p.obj as Boolean
                when (p.label) {
                    "CtrlJump" -> {
                        val oldjump = jump
                        jump = b
                        if (/*Grounded &&*/ jump && !oldjump) {
                            //jump!
                            Velocity.add(0f, JumpVelo)
                            if (Velocity.y > JumpVelo) Velocity.y = JumpVelo
                            Grounded = false
                            MAR.playSFX("jump")
                        }
                    }
                    "CtrlLf" -> left = b
                    "CtrlRt" -> right = b
                    "CtrlDn" -> forcefall = b
                }

                if (left && !right) {
                    Velocity.x -= WalkAccl * deltatime
                    if (Velocity.x < -1*WalkVelo) Velocity.x = -1*WalkVelo
                    drawdir = false
                } else if (right && !left) {
                    Velocity.x += WalkAccl * deltatime
                    if (Velocity.x > WalkVelo) Velocity.x = WalkVelo
                    drawdir = true
                }
            }
        }

        //easier to snap moving upward than downward
        if (Velocity.y > 0) Tolerance.x = tolup
        else Tolerance.x = toldn

        Mailbox.clear()
    }

    override fun poststep(deltatime: Float) {
        if (Velocity.y < 0)
            Grounded = false
        else if (Velocity.y == 0f) Grounded = true
        for (m in Mailbox) {
            when {
                m.label.startsWith("CollEnt/${Door.TypeName}") -> DM.ScriptSwap = "title"
            }
//            System.out.println(m.label)
        }
    }

    override fun checkCollEntity(deltatime: Float, e: Entity): Boolean {
        when(e.Type) {
            ThruPlat.TypeName -> return !forcefall && Velocity.y <= 0 && Position.y >= e.Position.y && mkVRect().overlaps(e.mkRect())
            Door.TypeName -> return forcefall
        }
        return false
    }

    override fun draw(deltatime: Float) {
        var rot = 0f
        if (Velocity.x != 0f) {
            wobbletime += deltatime*Velocity.x/WalkVelo
            if (wobbletime > wobbleperiod) wobbletime -= wobbleperiod
            rot = Math.sin(wobbletime/wobbleperiod*2*Math.PI).toFloat()*wobbledepth*-1
        }
        else wobbletime = 0f

        if (drawdir) {
            MGR.drawRgb("_guyrt", 0f, Position.x + 0.5f, Position.y,1f,1f,rot,Vector2(0.5f,0f))
            MGR.drawRgb("_gunrt", 0f, Position.x + 10/16f, Position.y,1f,1f,0f,Vector2())
        } else {
            MGR.drawRgb("_guylf", 0f, Position.x + 0.5f, Position.y,1f,1f,rot,Vector2(0.5f,0f))
            MGR.drawRgb("_gunlf", 0f, Position.x - 10/16f, Position.y,1f,1f,0f,Vector2())
        }
    }


}
<file_sep>package net.jorhlok.shootyshoot

import com.badlogic.gdx.ApplicationAdapter
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.Animation
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator
import com.badlogic.gdx.maps.tiled.TmxMapLoader
import com.badlogic.gdx.utils.Array
import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister
import net.jorhlok.oops.ObjectOrientedPlaySet


class ShootyShoot : ApplicationAdapter() {
    private var mgr: MultiGfxRegister? = null
    private var audio: MultiAudioRegister? = null
    private var oops: ObjectOrientedPlaySet? = null
    var statetime = 0f


    override fun create() {
        var bigpal = Array<Color>()
        bigpal.add(Color(0f,0f,0f,0f))
        bigpal.add(Color(0f,0f,0f,1f))
        bigpal.add(Color(4/15f,12/15f,2/15f,1f))
        bigpal.add(Color(13/15f,13/15f,13/15f,1f))
        bigpal.add(Color(7/15f,8/15f,1f,1f))
        bigpal.add(Color(0f,0f,0f,1f))
        bigpal.add(Color(4/15f,12/15f,2/15f,1f))
        bigpal.add(Color(13/15f,13/15f,13/15f,1f))
        mgr = MultiGfxRegister()
        mgr!!.palette = bigpal
        audio = MultiAudioRegister()
        mkav()
        mgr!!.Generate()
        audio!!.Generate()

        oops = ObjectOrientedPlaySet()
        oops!!.addTileMap("test0", TmxMapLoader(InternalFileHandleResolver()).load("map/test0.tmx"))
        oops!!.addTileMap("test1", TmxMapLoader(InternalFileHandleResolver()).load("map/test1.tmx"))
        oops!!.addTileMap("test2", TmxMapLoader(InternalFileHandleResolver()).load("map/test2.tmx"))

        val dm = TestDM("test2",mgr!!,audio!!)
        oops!!.addMasterScript("title", Title("",mgr!!,audio!!))
        oops!!.addMasterScript("pause", PauseDM("",mgr!!,audio!!))
        oops!!.addMasterScript("testdm", dm)
        oops!!.launchScript("title")
    }


    override fun render() {

        val deltatime = Gdx.graphics.deltaTime
        statetime += deltatime
        if (statetime >= 4) {
            System.out.println("${Gdx.graphics.framesPerSecond} FPS")
            statetime -= 4f
        }

//        val c = mgr!!.getBufCam("main")
//        c!!.translate(Math.sin(statetime*Math.PI/2).toFloat(),Math.cos(statetime*Math.PI/2).toFloat())
//        c!!.rotate(Math.sin(statetime*Math.PI/2).toFloat())
//        c!!.zoom = 0.5f
//        c!!.update()



//        mgr!!.fillShapes()
//        mgr!!.drawCircle(320f,180f,Math.sin(statetime*Math.PI/2).toFloat()*4+12,Color(0.2f,0.3f,1f,1f))

        //game logic
        oops!!.step(deltatime)
        try {
            oops!!.draw(deltatime)
        } catch (e: Exception) {
            System.err.println("Error drawing!")
            e.printStackTrace()
        }
        if (oops!!.Quit) Gdx.app.exit()

//        mgr!!.drawPal("_girl",4,0f,64f,64f,2f,2f,statetime*90, Vector2())
//        mgr!!.drawPal("_girl",0,0f,16f,16f,2f,2f,statetime*90)
//        mgr!!.drawPal("_girl",0,0f,48f,48f,2f,2f,statetime*90)
//        mgr!!.drawString("libmono","wubba lubba dub dub",Math.round(Math.sin(statetime*Math.PI/2)*64f+320f).toFloat(),Math.round(Math.cos(statetime*Math.PI/2)*64f+180f).toFloat(),1f,1f,0f,Vector2(0.5f,0.5f), mgr!!.palette[2])
//        mgr!!.drawString("libmono","wubba lubba dub dub\n\n  grass tastes bad",Math.sin(statetime*Math.PI/2).toFloat()*64f+320f,Math.cos(statetime*Math.PI/2).toFloat()*64f+180f,2f,1f,statetime*-90,Vector2(0.5f,0.5f), mgr!!.palette[2])
//        mgr!!.drawRgb("pacrt",statetime*3,320f,180f,1f,1f,statetime*-90f+90f)

    }


    override fun resize(width: Int, height: Int) {

    }


    override fun dispose() {
        oops?.dispose()
        mgr?.dispose()
        audio?.dispose()
    }


    fun mkav() {

        mgr?.newBuffer("main",640,360,640f,360f)

        mgr?.newImagePal("imgmap","gfx/imgmap.png",8,8)
        mgr?.newSpritePal("girl","imgmap",0,0,2,2)

        mgr?.newSpritePal("column","imgmap",30,4,2,2)


        mgr?.newMapTileRgb("sprites",241,"_greenblock")
        mgr?.newMapTileRgb("sprites",242,"_skyblueblock")
        mgr?.newMapTileRgb("sprites",243,"_whiteblock")
        mgr?.newMapTileRgb("sprites",244,"_greyblock")

        audio?.newMusic("frcasio", "bgm/FriendlyCasiotone.ogg")
//        audio?.newMusic("mkds", "bgm/mkdsintro.ogg", "bgm/mkds.ogg")

        audio?.newSFX("pew", "sfx/pew.wav")
        audio?.newSFX("jump", "sfx/jump.wav")
        audio?.newSFX("dash", "sfx/dash.wav")
        audio?.newSFX("growl", "sfx/growl.wav")


        val generator = FreeTypeFontGenerator(Gdx.files.internal("gfx/libmono.ttf"))
        val parameter = FreeTypeFontGenerator.FreeTypeFontParameter()
        parameter.size = 14 * 1
        parameter.magFilter = Texture.TextureFilter.Linear
        parameter.minFilter = Texture.TextureFilter.Linear
        parameter.hinting = FreeTypeFontGenerator.Hinting.Full
        mgr?.newFont("libmono",generator.generateFont(parameter),1f)
        generator.dispose()

        mgr?.newImageRgb("sprites", "gfx/sprites.png", 16, 16)

        mgr?.newSpriteRgb("guyrt", "sprites", 0, 0, 1, 1, false, false)
        mgr?.newSpriteRgb("guylf", "sprites", 0, 0, 1, 1, true, false)
        mgr?.newSpriteRgb("gunrt", "sprites", 1, 0, 1, 1, false, false)
        mgr?.newSpriteRgb("gunlf", "sprites", 1, 0, 1, 1, true, false)
        mgr?.newSpriteRgb("pac0lf", "sprites", 14, 0, 1, 1, false, false)
        mgr?.newSpriteRgb("pac0rt", "sprites", 14, 0, 1, 1, true, false)
        mgr?.newSpriteRgb("pac1lf", "sprites", 15, 0, 1, 1, false, false)
        mgr?.newSpriteRgb("pac1rt", "sprites", 15, 0, 1, 1, true, false)

        mgr?.newSpriteRgb("shot0", "sprites", 0, 1, 1, 1, false, false)
        mgr?.newSpriteRgb("shot1", "sprites", 1, 1, 1, 1, false, false)
        mgr?.newSpriteRgb("shot2", "sprites", 2, 1, 1, 1, false, false)
        mgr?.newSpriteRgb("shot3", "sprites", 3, 1, 1, 1, false, false)

        mgr?.newSpriteRgb("door", "sprites", 0, 2, 1, 1, false, false)
        mgr?.newSpriteRgb("pedestal", "sprites", 1, 2, 1, 1, false, false)
        mgr?.newSpriteRgb("alchemy", "sprites", 2, 2, 2, 1, false, false)

        mgr?.newSpriteRgb("mineral", "sprites", 0, 3, 1, 1, false, false)
        mgr?.newSpriteRgb("herb", "sprites", 1, 3, 1, 1, false, false)
        mgr?.newSpriteRgb("eyeball", "sprites", 2, 3, 1, 1, false, false)
        mgr?.newSpriteRgb("worm", "sprites", 3, 3, 1, 1, false, false)
        mgr?.newSpriteRgb("dollar", "sprites", 4, 3, 1, 1, false, false)
        mgr?.newSpriteRgb("potion", "sprites", 5, 3, 1, 1, false, false)
        mgr?.newSpriteRgb("mana", "sprites", 6, 3, 1, 1, false, false)
        mgr?.newSpriteRgb("coffee", "sprites", 7, 3, 1, 1, false, false)

        mgr?.newSpriteRgb("redbar", "sprites", 0, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("darkredbar", "sprites", 1, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("bluebar", "sprites", 2, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("darkbluebar", "sprites", 3, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("yellowbar", "sprites", 4, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("darkyellowbar", "sprites", 5, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("uiback", "sprites", 6, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("uislot", "sprites", 7, 4, 1, 1, false, false)
        mgr?.newSpriteRgb("cursor", "sprites", 8, 4, 1, 1, false, false)

        mgr?.newSpriteRgb("greenblock", "sprites", 0, 15, 1, 1, false, false)
        mgr?.newSpriteRgb("skyblueblock", "sprites", 1, 15, 1, 1, false, false)
        mgr?.newSpriteRgb("whiteblock", "sprites", 2, 15, 1, 1, false, false)
        mgr?.newSpriteRgb("greyblock", "sprites", 3, 15, 1, 1, false, false)

        mgr?.newAnimRgb("newshot", Array<String>(arrayOf("shot0", "shot1", "shot2")), 0.125f, Animation.PlayMode.NORMAL)
        mgr?.newAnimRgb("shot", Array<String>(arrayOf("shot3", "shot2")), 0.01f, Animation.PlayMode.LOOP)
        mgr?.newAnimRgb("paclf", Array<String>(arrayOf("pac0lf", "pac1lf")), 0.5f, Animation.PlayMode.LOOP)
        mgr?.newAnimRgb("pacrt", Array<String>(arrayOf("pac0rt", "pac1rt")), 0.5f, Animation.PlayMode.LOOP)
    }
}
<file_sep>package net.jorhlok.shootyshoot

import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister

/**
 * Created by joshm on 6/15/2017.
 */
class ThruPlat(MGR: MultiGfxRegister, MAR: MultiAudioRegister) : SSEntity(MGR, MAR) {
    companion object {val TileNum = 67; val TypeName = "ThruPlat"}
    init {
        Type = ThruPlat.TypeName
        CollEntities = true //allow collisions
        CollEntWhite = emptySet() //but I don't pay attention
        AABB.set(0f,6/16f,1f,4/16f)
    }
    override fun draw(deltatime: Float) {
        MGR.drawRgb("_bluebar",0f,Position.x+0.5f,Position.y+0.5f)
    }
}<file_sep>package net.jorhlok.shootyshoot

import com.badlogic.gdx.math.Vector2
import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister

/**
 * Created by joshm on 6/15/2017.
 */
class Alchemy(MGR: MultiGfxRegister, MAR: MultiAudioRegister) : SSEntity(MGR, MAR) {
    companion object {val TileNum = 35}
    override fun draw(deltatime: Float) {
        MGR.drawRgb("_alchemy",0f,Position.x,Position.y,1f,1f,0f, Vector2())
    }
}<file_sep>package net.jorhlok.shootyshoot

import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister
import net.jorhlok.oops.DungeonMaster

/**
 * Created by joshm on 6/17/2017.
 */
class Title(mapname: String,
            var MGR: MultiGfxRegister,
            var MAR: MultiAudioRegister) : DungeonMaster(mapname) {

    override fun begin() {
        MGR.camera.setToOrtho(false,640f,360f)
        MGR.updateCam()
        MGR.getBufCam("main")?.setToOrtho(false,640f,360f)
        MGR.setBufScalar("main")
    }

    override fun prestep(deltatime: Float) {

        if (Gdx.input.isKeyPressed(Input.Keys.SPACE) || Gdx.input.isKeyPressed(Input.Keys.ENTER))
            ScriptSwap = "testdm"
    }

    override fun draw(deltatime: Float) {
        MGR.startBuffer("main")
        MGR.clear(0.1f,0.1f,0.1f,1f)
        MGR.drawString("libmono","Press Start",320f,180.5f)
        MGR.stopBuffer()
//        MGR.drawBuffer("main")
//        MGR.flush()
    }

    override fun flip() {
        MGR.drawBuffer("main")
        MGR.flush()
    }

    override fun clone() = Title(MapName,MGR,MAR)
}<file_sep>package net.jorhlok.shootyshoot

import net.jorhlok.multiav.MultiAudioRegister
import net.jorhlok.multiav.MultiGfxRegister

/**
 * Created by joshm on 6/16/2017.
 */
class Collectible(val anim: String, x: Float, y:Float, MGR: MultiGfxRegister, MAR: MultiAudioRegister) : SSEntity(MGR, MAR) {
    val animlen = 2f
    var statetime = Math.random().toFloat()*animlen
    val hoverdepth = 4/16f
    val hidelen = 5f
    var hidetime = hidelen

    init {
        Position.set(x,y)
        AABB.set(0f,0f,1f,1f)
        val s = HashSet<String>()
        s.add("TestPlatformer")
        CollEntWhite = s
        CollEntities = true
    }

    override fun poststep(deltatime: Float) {
        for (m in Mailbox) {
            if (hidetime >= hidelen && m.label.startsWith("CollEnt/")) {
                hidetime = deltatime*-1
                statetime = hidetime-hidelen
                MAR.playSFX("pew")
            }
        }
        if (hidetime < hidelen) hidetime += deltatime
    }

    override fun draw(deltatime: Float) {
        statetime += deltatime
        if (statetime > animlen) statetime -= animlen
        if (hidetime >= hidelen) MGR.drawRgb(anim,0f,Position.x+0.5f,Position.y+0.5f+Math.sin(statetime/animlen*Math.PI*2).toFloat()*hoverdepth)
    }
}