RT @theBanov: ICYMI, @CoinCrypt's 50% off + new expansion came out this week. Deck-building roguelike! t.co/mmT1HqqS76 t.co/i… (Today)

@saint11 c'mon be unsafe what's the worst that can happen (Yesterday)

@NoelFB @theBanov rip rip rip in peace (Yesterday)

@TeddyDief there would be a lot of public safety ads about not getting telefragged (Yesterday)

@soylent I placed an order for 2.0 back on 9/20 and haven't heard anything since "Label Created." Didn't hear back from support either :( (Yesterday)

@MattThorson hmm probably should have forward momentum into the slash so I can slash dash cancel into a leap and then ground pound. (2 days ago)

@goldbuick huh? o_o (2 days ago)

Pure Entity Component systems stuff look super cool and fun but I never have any idea how to apply it to my projects t.co/RC1et7D4Ba (2 days ago)

@gabrielviolence damn you got a free midnight raccoons show #jealous (3 days ago)

@Capn_Andy yeah they had those in august it was fucked up man (3 days ago)

@sgricci Wow nice :O (3 days ago)

@sgricci Yeah I unfortunately have no idea how to make it run in linux x_x (3 days ago)

There's now examples all the way up to "Sound and Music" for using my game making framework, Otter! t.co/E1a9eHjHSP (3 days ago)

@raiganburns @MattThorson Oh all of my bugs right now are currently caused by the slopes haha, gonna dig in some more today. (3 days ago)

@raiganburns @MattThorson they all take turns moving 1 px until all movement is done. I don't want any frames of showing overlap :o (3 days ago)

@gabrielverdon what the hell this is breaking my brain (4 days ago)

@braceyourselfok fun is the perfect random reward schedule timing to make sure levels of dopamine peak with anticipation of course!11 (4 days ago)

@larsiusprime Yeah this is Otter. I mean if I can understand the logic it shouldn't be an issue to port it over to C# Otter code. (4 days ago)

@larsiusprime Hmm I should check it out at least though! always can learn stuff from other approaches (4 days ago)

@larsiusprime I mostly just want a system of things that can be pushed and carried that applies to all the game objects, with slopes! (4 days ago)


2013 - 2 - 18 / 12:42 pm / games

Dev Log: Slopes and Slopes

Dev Log: Slopes and Slopes

Still working on the re-make of my Global Game Jam game! The most recent development I can talk about is this:



Look at those beautiful SLOPES! I haven't actually done any platforming with slopes since all the way back in 2009 when I first made Jottobots (and before that, Verge.) This is my first time doing slopes of any sort in Flashpunk. There were a couple of hurdles to get over to get them working smoothly though.

The first major hurdle is that I'm using Ogmo Editor for all my level data. Usually my method of making collision data in Ogmo Editor is to just use a "grid" layer, and then that gets imported into my Flashpunk project as a Grid collision mask. That usually works, but in the case of slopes it does not... the Grid only supports a tile grid of solid boxes of collision -- no slopes!

My way of solving this was to go back and change my grid layer to a layer of tiles. I made a small tile sheet that contained all of the slopes that I wanted to use, and drew the collision with that. The tile sheet looked like this:

So now I could export data from Ogmo that would have solid blocks and slopes. Note that it's important to keep the tile at 0,0 completely blank, otherwise there are some complications in the Flashpunk code to convert it to collision data.

Next I made this ugly looking function that takes a tilemap and converts it into a bunch of collision data of a given type. Note that this function is in my "Level" class, which extends "World"

public function solidTilesToGrid(tilesEntity:String, type:String):void {
var tilesSolid:Entity = getInstance(tilesEntity);
var tileMap:Tilemap = tilesSolid.graphic as Tilemap;

addMask(tileMap.createGrid([7]), type);

var tilebitmap:BitmapData = tileMap.tileset;
var maskbitmap:BitmapData = new BitmapData(16, 16, true, 0);

for (var xx:uint = 0; xx < tileMap.columns; xx++) {
for (var yy:uint = 0; yy < tileMap.rows; yy++) {
var tile:uint = tileMap.getTile(xx, yy);
if (tile != 0 && tile != 7) {
maskbitmap.fillRect(maskbitmap.rect, 0);
maskbitmap.copyPixels(tilebitmap, tileRect(tileMap, tile), zero);
addMask(new Pixelmask(maskbitmap.clone()), type, xx * tileMap.tileWidth, yy * tileMap.tileHeight);


if (!drawCollisions) {
tilesSolid = null;

The function first uses tileMap.createGrid() which is a Flashpunk function that will convert tiles of a certain index into a Grid for collision. In my case, the 7th tile on my tilesheet was the completely solid one, so I use [7] for that function. The next part is a little weird. I iterate through all the tiles on the tileMap, and if I hit a tile thats not blank, and that's not the 7th (completely solid) tile, then I must be looking at a slope. I end up copying the pixels from the tile I'm looking at, and then I make a pixelmask out of it. I then add the pixelmask to the world with addMask(), and that results in all of the slopes being copied into pixel mask collision data.

There's also the function tileRect() in there, which just returns a rectangle of the corresponding pixel data for any tile on tilemap.

So that's what I'm working with right now. I'll save the actual collision / moving up and down slopes for next time!


2013 - 2 - 18 1:29 PM


Thanks for posting about this! I love FP and Ogmo, but I've hit the "how the hell do I do slopes" wall a few times now. I'm glad I seem to be on the right track so far, and I'm looking forward to seeing more of your thoughts on the subject.


2013 - 2 - 18 1:33 PM


Awesome! Glad I could help :) The only issue right now is that I create a separate pixel mask for each slope, but I think this might be the best way to go... the only other thing I could think of was a big pixel mask for the entire tile layer, but that's probably horrible for performance.


Post your comment!




Hi there, my name is Kyle, and I'm a kid disguised as a grown up. I'm making video games and living the indie game developer life in Tempe, Arizona. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. I also created and maintain Otter, a 2d game making framework. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by! You're the coolest.

blog stuff






Do you want to make a Let's Play of one of my games, or a just a video featuring footage of my games? You have my full permission to do so! Even if you are monetizing your videos, you still have my full permission to use any footage from any of my games. Go for it!


Your message has been sent! Thanks :)