@TMirroar @aurahack whoa cool :O also gradient maps are da best~ ;D (Today)

RT @JassonMcMorris: Selling my Indie Game Summit pass for #GDC17. Contact me if you're interested or you know someone who is. #gamedev #ind… (Today)

@GreyAlien my math is rusty but make 2 right triangles to get the angles on the outside of the ?, then 180 - those two combined = ? I think? (Today)

@dannyBstyle it's a controller when I'm playing, but then it's a gamepad when I'm programming. (Today)

@RoseCuddles I think I caught the second one 1 frame after it hit me (in the 3 frame window you have to twitch grab) (Today)

@renaudbedard this dungeon scared the poops out of me when I was a kid to the point where I could barely get through it haha (Today)

@andrewbrophy rare hunters arc was so good... (Today)

Back in Denver. Thank you so much to @KingOfElks @DrSkipper_ @zecmo @SD_Siggy and the whole Towerfall community for an amazing weekend 😎💙😆💖🏹 (Today)

@MattThorson I feel even cooler then (Yesterday)

@MattThorson whooaaa huge if tru (Yesterday)

@MattThorson ohhh is dodge input buffered? (Yesterday)

@MattThorson looking closely I think I had a 2 frame window on the second catch. 24 frames between each grab meaning I had to twitch the 2nd (Yesterday)

@MllePilgrim I never asked for these powers (Yesterday)

@infinite_ammo how night in the woods became night on the toilet (2 days ago)

@infinite_ammo several injured in a poutine related incident earlier today. are your children safe? find out more at 11. (2 days ago)

probably the most clutch miracle grabs of my life during the genesis4 towerfall tournament~ t.co/Inqe3L6FdJ (2 days ago)

RT @spikevegeta: Soooooooooo... Does it weird anybody else out that half of Twitch Sub Emotes are of Anime Girls Climaxing? (2 days ago)

I keep getting rewarded for my strategy of not eating or drinking at all during towerfall tournaments and this can't be good in the long run (2 days ago)

@ChevyRay 2g gaming streamed it (2 days ago)

@MllePilgrim :3 (2 days ago)

posts tagged with: actionscript

2013 - 5 - 22 / 12:57 pm / tutorials

Disable ESC in Fullscreen on Adobe AIR

Disable ESC in Fullscreen on Adobe AIR

One of the issues with building a desktop application with Adobe AIR is that there is a built in function in the runtime that will cancel any full screen mode when the user pushes the Escape key. This is mostly a functionality of Flash, but it carries over to AIR since AIR is pretty much an extension of the Flash runtime.

Fortunately when you're using the AIR runtime you can actually override the default functionality of the Escape key and keep your application full screen when the user pushes Escape. This came up in Offspring Fling because I was using the Escape key in my UI design. The user pushes Escape to return to the main menu, pause the game, or skip cutscenes, so it was a problem when escape also canceled the game's full screen mode.

The fix for this is super easy and straight forward. First you just need an event listener on the stage for the KEY_DOWN KeyboardEvent.

//listen for key down event and trigger escOverride function
FP.stage.addEventListener(KeyboardEvent.KEY_DOWN, escOverride);

Now here's what the escOverride function looks like.

private function escOverride(e:KeyboardEvent):void {
if (e.keyCode == 27) {

The keyCode for the Escape key is 27, so whenever a key is pressed the function escOverride is called. If the keyCode was 27, then the preventDefault() function will prevent the default action from being triggered. In this case, it's the "exit fullscreen" action.

There you have it! With just 4 or 5 lines of code total you can prevent your Adobe AIR game from canceling fullscreen when the user pushes Escape. With great power comes great responsibility. (Also note that I believe this is impossible in a normal swf build. The preventDefault() function only works in Adobe AIR.)


2013 - 3 - 13 / 3:46 pm / tutorials

Adobe AIR Window Scaling

Adobe AIR Window Scaling

Over the past week I added some menus and options to my Global Game Jam game remake. I'm doing this super early on in the game's life because having some awesome polished menus makes it feel like a "real" game, which motivates me to work on it more. One of the first things I did for the game options was window scaling. The game natively runs at 320 x 240, so obviously players are going to want some various scaling options unless they really want to run it at 1x and barely see the game on their screens that are now probably 4000 pixels wide.

The awesome thing about working in AIR is that it will automagically resize the game's window to the size of the flash stage, so all I have to do is set the stage width and the stage height and the window will resize to match. However, there are some funky issues that can arise.

The flash stage has different scaling modes that you can use. There's EXACT_FIT, NO_BORDER, NO_SCALE, and SHOW_ALL. For the case of this game, I'm using EXACT_FIT after I resize the window. The reason for this is so that players with super huge monitor set ups can scale the window themselves.

This was actually a problem with Offspring Fling until the lastest update. I had a player that had a desktop width of over 4000 pixels because of their multimonitor set up. They couldn't play in fullscreen mode because it would scale across both monitors, and they couldn't play in windowed mode because it was too tiny. Changing the window mode to EXACT_FIT made it so anyone can scale the window to whatever size they want. I could've also used SHOW_ALL, which would maintain the game's aspect ratio as it scaled, but some users wanted to stretch the game to fill their entire monitor. (WHY?!) read more

No Comments

2013 - 3 - 11 / 2:27 pm / tools

Flashpunk NineSlice Class (Updated!)

Flashpunk NineSlice Class (Updated!)

Last week I posted a quick NineSlice class that I wrote to work in Flashpunk. It was a little clunky, so this past week I cleaned it up and integrated it with Flashpunk's graphic system. The new version now extends Image, so you get all the awesome Image effects like color tinting, rotation, scaling, and more. Check out the new version!


As a quick example, here's how I'm using it in my current project. Check out this screenshot of a menu:

Thanks to the handy dandy nine slice object, most of this menu is just drawn with a couple of simple source images. I scaled them up 4x so you could see them a little better.

Just using these images as sources means I don't have to make a new image every time I want to change the size of one of the widgets. I can also do some cool animations with tweening the width and heights of the panels over time.

Feel free to use the NineSlice.as class however you want. If you use it or improve it in anyway, let me know!


2013 - 3 - 6 / 2:14 pm / general

A Flashpunk 9-Slice Object

A Flashpunk 9-Slice Object

As I've been working on this Global Game Jam game remake, I've been trying to come up with solutions for problems that I can hopefully reuse for more projects in the future. One of the things I've been thinking a lot about is managing and drawing the various user interfaces for the game. Even though I'm not quite sure how much UI stuff this game will need, I wanted to have some sort of solid base to start with so that I could get stuff up and running quickly.

One of the most basic core structures of drawing a cool UI (in my opinion!) is a 9-slice graphic object. What's a 9-slice graphic object?! Well, here's a quick example of one that I have working in Flashpunk right now.

The box that is being drawn above the red player rectangle is a working example of my NineSlice class. It's being drawn from a source image of nine tiles. The source file has four tiles for the corners, four tiles for the sides, and one tile for the center. Here's what the source looks like (blown up 4x because it is tiny.)

This is incredibly useful because it's now possible for me to draw stylized boxes for potential UI components at any size without having to draw each one individually. One thing that I wish that I had spent more time on in Offspring Fling is the UI for the menus, so in the future I want to make my menus and interfaces as awesome as they can be, and having some functions do a lot of the fancy work for me is a big step in that direction. Here's what it looks like right now: NineSlice.as

Here are some snippets of code from the example shown above:

//initial set up
private var nineSliceTest:NineSlice = new NineSlice(Assets.IMG_NINE_SLICE_TEST, 3, 3, 3, 3);
//in the entity's constructor
nineSliceTest.scrollX = nineSliceTest.scrollY = 0;
nineSliceTest.width = 40;
nineSliceTest.height = 40;
nineSliceTest.x = 50;
nineSliceTest.y = 50;
//in the entity's render function

Right now this is a very rough first pass on this kind of thing. Ideally it would be some sort of Flashpunk graphic extension that would plug directly into the Flashpunk rendering system. For now it makes use of the Flashpunk Draw class, and some utility functions that I've written for myself. Feel free to use it or improve it, and if you end up improving it then let me know!


2013 - 2 - 20 / 10:49 am / tutorials

Colliding with Slopes?!

Colliding with Slopes?!

In my last blog post I talked a little bit about how I've implemented slopes in my latest project, but I only talked about how I was actually importing them from Ogmo Editor into Flashpunk and not about how I'm actually using them for platforming. In this post I'll attempt to explain how I actually use slopes in my movement system, which means my platformer characters can walk up and down them without any problems.

The first thing to keep in mind is that all of my slope code only really works with slopes that increase or decrease by 1 pixel. I could rework some of it to make it work with a step of any size that the programmer could define, but for now 1 step is all I really need.

Pixel Sweepin'
The first thing to know is how I actually go about moving my platformer characters, and other moving objects around my game world. I use a method that I refer to as pixel sweeping. Basically whenever an object moves in my games, I move it one pixel at a time and check for collisions at each step! This might sound a little crazy to some folk, but this is the most reliable way I've been able to do stuff like platforming and other moving objects and still collide with even the tiniest pixel of a floor or wall. I've been using this technique since the very beginning of Bonesaw: The Game. read more

1 Comment

2013 - 2 - 13 / 11:00 am / tools

Game Making Tools

Game Making Tools

Since I posted the time lapse video of me making a game for Global Game Jam 2013, I got a couple of questions regarding the exact tools I'm using for my game making needs. This is a pretty long post, so I'm going to put it all behind the jump tag. If you want to know my secrets, then click read more! read more




Hi! My name's Kyle, and I make video games most of the time in Denver, Colorado. 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 :)