31 May, 2008
Now that I will soon be releasing much more code and files I decided to go ahead and set up a google project page. You can set up a "read-only" repository to download all of my code as it is updated and added to or download the code as I post it in the packages with the demos / tutorials.
Check it out here: http://code.google.com/p/cheezeworld/
If you would like to contribute some code or a helpful tutorial etc I'd be happy to add it to the project!

Loading ...
31 May, 2008
While programming my game's "Entity Framework" as I like to call it, I had the need for a better way to initialize all of my entities. Here are the properties for just the base "Entity" class:
public class Entity extends EventDispatcher{
public static const DISPOSE:String = "dispose_event";
public var pos:Vector;
public var rotation:Number;
public var scale:Number;
public var radius:Number;
public var isCollidable:Boolean;
public var team:String;
public var _id:String;
public var _type:String;
public var _pos:Vector;
public var _oldPos:Vector;
public var _world:GameWorld;
public var _timePassed:int;
//...the rest of the code
}
Also I wanted to have default values as well as the ability to load the defaults from some sort of "Settings" file for pretty much all of these values so normally you would have to do your constructor like:
public function Entity(position:Vector, rotation:Number=360, scale:Number=1, radius:Number=1, isCollidable:Boolean=true, team:String="neutral", id:String=null, type:String=null, world:GameWorld=null){
if(pos != null) { pos = position; } else { pos = new Vector(); }
if(rotation != 360) { rotation = rotation } else { rotation = Settings.EntityRotation; }
//etc...
}
So as you can see that would get pretty messy ESPECIALLY when you decided to extend it since you'd have to put all of those properties in the constructure PLUS any new properties...so you can just imagine the headache there.
Anyways lets just cut to the chase. Here is the wonderful solution I came up with to handle any type of constructor nightmare like that: Read the rest of this entry »

Loading ...
30 May, 2008
I've done some collab coding work as well as plenty of my own projects and if you have done the same you would probably agree that debugging can be one of the biggest tasks that we as programmers have to face in our projects.
Usually proper debugging consists of many many trace statements until we are able to pinpoint areas that aren't doing exactly what it is that we want our code to be doing. Well, one problem that I have run along many times within my own code and more so when working with other people's code is the problem of not being able to find trace statements and / or not knowing where a particular trace statement came from!
Take for example Read the rest of this entry »

Loading ...