@ChevyRay I think you're really dang good at it to achieve that pace. It takes me like forever and a million years for editor features ;_; (Today)

@infinite_ammo cancel all my meetings that i didn't have. looks like i have other plans for today. (Today)

@infinite_ammo hahahh fuck I dont remember that and I should be all caught up. I must have missed that... (Today)

RT @Draknek: The Stugan deadline is coming up soon and @bnhw and I want to work on a new project there, looking for a 3D artist: t.… (Today)

@infinite_ammo oh god he's slamming the baby in the toilet. it's only a matter of time before he turns his toilet seat into a subwoofer too. (Today)

@infinite_ammo my fav is my upstairs neighbor who slams his toilet seat down also now apparently has a screaming baby in his apartment?? (Today)

@ChevyRay ugggghhhhh I LOVE MAP VIEWS OF THINGS AHHH (Today)

@jwaaaap I don't think you need to be SUPER HARDCORE but you def need platforming skills and the map system can seem kinda brutal at first (Yesterday)

@ChevyRay hi here is my tutorial on regular expressions this is how to verify an email address s/g+.a-Z0-9[]{/gi-?@/f-[a-Z]0-9??/gmail.com (3 days ago)

@TommyRefenes the lengths you'll go to become a metal gear solid boss amaze me (3 days ago)

@shaneneville t.co/9H8F5KlgFA (4 days ago)

@shaneneville well that sounds rad as fuck jfc (4 days ago)

@shaneneville tell me more (tabletop / pen and paper rpg systems are super duper fascinating to me) (4 days ago)

@Fruckert depends on my pace. if I'm working super fast I'll just have a text file in my csproj folder. if I'm slower I'll use trello. (4 days ago)

@ADAMATOMIC I'm not far into this talk yet but do they discuss how most of the costumes make characters look entirely different and incompre (4 days ago)

I'm excited to make games today! *checks task list* Oh right I'm stuck on like 50 bugs I don't know how to solve. (4 days ago)

@ADAMATOMIC just now realizing that I need a giant motivational poster of nasir over my desk at all times (5 days ago)

@obskyr YEAH I was bummed that the Hollow Knight soundtrack turned a bunch of the loops into short songs or arrangements :I (5 days ago)

I humbly request for video game soundtracks to feature more than one loop on the tracks that normally loop in the game~ (ESPECIALLY BOSS TRA (5 days ago)

RT @bitmOO: Hi, I make playful art! :) If you like my work please consider supporting me: 🐮 t.co/dFSRVxbXzf ☕️ t.co/F2hPwao… (5 days ago)

follow
search
posts filed under: tutorials

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) {
e.preventDefault();
}
}


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

8 Comments

2013 - 5 - 14 / 11:03 am / tutorials

AS3 State Machine

AS3 State Machine

State Machines are the greatest thing I've ever discovered when it comes to programming games. More and more I'm beginning to realize that a lot of the structure of the tools I've used is in fact a state machine!

Finite State Machines
To find out exactly what a state machine is, check out this wikipedia article which describes them as "...an abstract machine that can be in one of a finite number of states. The machine is in only one state at a time; the state it is in at any given time is called the current state. It can change from one state to another when initiated by a triggering event or condition; this is called a transition. A particular FSM is defined by a list of its states, and the triggering condition for each transition."

An example of this in action in my games are the guards in Super Ninja Slash. They have a couple of different states. Idle, Alarmed, Shooting, and Dead. That covers all their bases for their behavior.

Without using a state machine, writing code for all of that behavior can quickly become a giant mess of if statements and booleans. With a state machine, I can completely separate all the code for the guard's Idle state, the Alarmed state, Shooting, and Dead. read more

3 Comments

2013 - 4 - 23 / 4:00 pm / tutorials

FlashDevelop to iPad Workflow

FlashDevelop to iPad Workflow

I recently got one of them new fangled iPad things and I heard on the internet that Adobe AIR is actually pretty decent at building things for iOS. Offspring Fling used Adobe AIR so I'm already a little familiar with how to build for Windows and Mac, but it turns out that iOS is an entirely different beast... sort of. The set up and configuration of the whole workflow can be a nightmare, but once it's over then you'll have a set up that lets you push F5 to build right to your device!

Follow along on this series of text and images and hopefully you will be enjoying pushing the F5 key on your keyboard and seeing an app pop up on your iOS device! Also put on some relaxing music because some parts of this tutorial might be hard to understand and frustrating. I'm using Windows 7 64-bit for this. read more

15 Comments

2013 - 4 - 8 / 12:21 pm / tutorials

FlashDevelop with HaXe NME and HaXePunk

FlashDevelop with HaXe NME and HaXePunk

I spent most of yesterday diving into a whole new world of magic and fun: Haxe. I was hesitant at first because I was dreading the whole ordeal of setting up a new development environment, but it turned out to be way more straight forward than most set ups I've experienced.

I ended up getting a quick demo of thousands of entities rotating, scaling, and alpha blending at a steady 50-60fps with the Windows build of HaxePunk, and that has me pretty excited!

Image

Follow along as I take you on a journey of code and game development! (For reference, I'm using Windows 7.) read more

11 Comments

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

about

About

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

categories

tags

archives

facebook

videos

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!

contact

Your message has been sent! Thanks :)
SEND MESSAGE