@ArthG yeah just a normalized vector between the mouse position and the shooter position (Today)

@Livelyivy Hahah awesome. Gotta use those NUKES. I always think of Tetran from the Gradius games t.co/DL1NJ2nGuu (Today)

Quick test of an enemy composed of individually destructible pieces yahoo t.co/w4j4SrfPKq (Today)

@gavanw Ohhh YEAH? I think I have it working (until I find some a crippling bug I'm sure) but I'm def interested in any pointers! (Today)

@konjak @snakepixel I find that if I start to plan things, I intimidate myself a lot. That's why game jams are so fun for me, no planning. (Today)

@AsherVo careful don't reach the resonance frequency of existence and shatter us all into a pocket universe between the membranes of reality (Today)

@BeeMickSee @pietepiet people will complain about whoever you main for whatever reason so just follow your heart (Today)

@rabbit_nabokov @konjak hahahahh cereal mascot I'm dying (Today)

@BeeMickSee @konjak @DamianSommer Yoo with all the Mario Kart DLC I think Smash DLC is def happening (Today)

@konjak @vonFawks @pietepiet I'm honestly surprised Dark Samus wasn't a character. (Today)

@vonFawks @konjak @pietepiet no more Kirby characters, make a Kirby/Jiggly clone that is a Metroid. (Today)

@pietepiet @konjak maybe they'll announce removing dark pit (Today)

@NoelFB I have done this in AS3, with loops, if, else, and everything. If you want the source to look at, let me know! (Today)

@SteveSwink @TommyRefenes I wonder how many Ultron forms there will be and which one of them will be the Stan Lee cameo (Yesterday)

@Doomlaser @TommyRefenes Oh sorry was totally thinking of Spine which I already use. Spriter seems to have no official api support. (Yesterday)

@Doomlaser @TommyRefenes Plus is going to be for making skeletal based stuff procedurally, not sure how any tool would help there :I (Yesterday)

@Doomlaser @TommyRefenes I have no idea how to bind my entities into anything that spriter has, plus I can't distribute their runtime easily (Yesterday)

@TommyRefenes cool let me just spend 10000 years writing swf importers (Yesterday)

@DiscordGames Hahah yeah, it is too easy to procrastinate on game design problems by just working on engine/tech stuff ;p (Yesterday)

@DiscordGames Building this so I can make enemies that have individual destructible parts, like big bosses and what not. (Yesterday)

follow
search
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) {
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.)

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

NineSlice.as

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

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

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

6 Comments

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.

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

Image
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
nineSliceTest.render();

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!

2 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

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

2 Comments

about

About

Hi there, my name is Kyle, and I'm a 27 year old kid with adult powers. 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.

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