Browsing the archives for the Code category

Motherfucking AS3 Garbage Collection

I like to think that I’m a responsible developer. I make good constructors and deconstructors to prevent memory leaks, I have fairly secure coding habits, I OOP the hell out of everything, and I do everything by-the-book. Imagine my frustration, then, when all of my games (particularly my latest, Steambirds) have gigantic memory leaks. Like, [...]

43 Comments

Decimal or Integer to Binary / AS3 Code

I had a need for this routine in Protonaut, and Ryan Madsen was gracious enough to pseudo-code this up for me. I then converted it to proper AS3 and to suit protonaut’s needs. It’s modifiable easily enough, but here’s the basic premise: Input a decimal (say, the number 1) and request an array length in [...]

0 Comments

FlexSDK 3.3 How To Make a Flash PreLoader in AS3

EDIT: The free code-IDE FlashDevelop does a really good job of doing all these steps for you! I recommend everyone switch to it. :) One of the things that has been vexing me lately is trying to get a Flash PreLoader working for my games. I’ve tried Googling it, but there are too many like-terms: [...]

4 Comments

Bug: Destroyed

Another entire weekend devoted to a single bug! I thought it was a seperate hideous bug from last time, but it was in fact the same bug in a different disguise. After some help with the Box2D Community I was able to trace it down to a bug in the engine – and upgrading to [...]

0 Comments

Critical Error

I’m still working on the game. I’ve run into a critical crashing bug in the Box2D engine – and it’s one of those ones that, if unsolved, it ruins the entire premise of the game. I can’t put it off and work on it later, it’s going to have to be resolved before I can [...]

1 Comment

The Platformer

OK, here’s something I really hate. Coding how a player moves. It turns out there’s a lot of intricate guesswork going on behind the scenes of most platformers. For instance, did you know that many platformers change the amount of friction exerted on the player body depending on the current action? Or that bodies accelerate [...]

0 Comments

Building a FrameWork

I don’t know if “FrameWork” is the right word, but I’m stealing it for my own personal use. Towards the end of developing SpaceSquid, my poor programming was catching up with me. Writing code quickly != quick running code. I think I iterated through the entire world object list several times per tick… Anyway, I [...]

1 Comment

MXMLC Ruins FileSizes

While working on Build 45 today I noticed something – that my file size for the project had almost hit 200KB. That’s a lot of KB. And considering a pretty big chunk of the population in the US is still on Dialup, it’s an unacceptably large number of KBs. It was taking 2-5 seconds to [...]

1 Comment

Research

I’ve been spending the last few days just researching – reading up on Flash forums and the Box2D common issues. I’ve learned quite a few things and have a better grip on how I’m going to implement this now. One bug that Fantastic Contraption has always had, is the “Collision skipping.” When an object moves [...]

0 Comments

The Art of Sticking to the Plan

So I ran into a lot of trouble with Flash yesterday. Seems that compiling from the Flex SDK (mxmlc.exe) produces different results from most compilations in any sort of framework. Great example; var a:Number = 1/3; var b:Number = 1.0/3.0; In MXMLC, VariableA is equal to 0, and B is 0.3333. In IDEs (Flash, FlashStudio, [...]

0 Comments