#15MinGameJam no.4: A twenty second platformer

Play the game here

This one was probably a little overambitious, but I surprisingly managed to go only five minutes over the time limit. I wanted to make a single-screen platformer, and figured that rather than adding enemies and having to worry about AI, I should just add some simple objects to be collected within a time limit.

That was all fine, but I ended up getting stuck on a weird bug with the FlxTilemap: I wanted to have a simple border all around the map so created a long strings representing this, like so:

private var level:String =
"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\n";

For some reason, this was only loading into the tilemap halfway, with the entire bottom half cut off for no apparent reason. It took me precious minutes to figure out what the issue was and finally try this instead:

private var level:String =
"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n" +
"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\n";

I’m not quite sure what the issue was, perhaps some limit within Haxe on multi-line strings? At any rate, this whole issue set me back and annoyingly I probably would have completed the remainder of the game in under fifteen minutes if I hadn’t have gotten stuck.
Ah well, I still finished a game and it even contains procedurally generated content! It may just be randomly setting tiles to create random platforms, but it still counts…I think.

Play the game here

Download the source code here

Leave a Reply

Your email address will not be published. Required fields are marked *

*