Using Objects for initialization

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 »

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Lost in Debug Hell : Fix Your Messy Trace Commands!

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 »

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

How to use Flex for your Actionscript only projects

During this tutorial I will explain how to set and get started with using Flex, as well as explain some of the not so obvious at first things that go along with it. Watch the first minute or so for an intro and then you can skip to the different parts depending on what help you need (or just watch the whole thing).

Read the rest of this entry »

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

Animated Bitmap Class. This Will Speed up your games!

It took me a bit longer than I thought, but it is done! I have created a custom "BitmapClip" class for you guys! This class can do it all:

  1. Import MovieClip, Sprite, and even Tile sheets!
  2. Animate each clip at it's own frame rate.
  3. Control it just like you would a MovieClip.
  4. It even creates pre-rotated frames for you! Now you can have super fast animated clips AND support rotation! WOOT.
  5. You can also support scaling by simply adding the clip to a sprite without losing *much* speed.

If you want to see a demo where I am using the BitmapClip with thousands of clips on screen moving / scaling and rotating then go here: Game Framework Test

You can download the package containing all of the code and demos or simply grab the file off of the repository on my Google project page.

The following are instructions on how to use it (which are included in the download as well):
Read the rest of this entry »

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 5 out of 5)
Loading ... Loading ...

Simple and Easy to Use Custom Input Manager Class

Sweet! It's ready to go. I have created a custom Input Manager for you to take advantage of. Check out this quick video tutorial that will walk you through how to use it in your projects or feel free to look it over yourself.

You can download the package containing the demos and the files or just grab it directly from the repository on my Google Project Page.

Read the rest of this entry »

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5 out of 5)
Loading ... Loading ...

Breakball

Description:
Control your Break Ball through a series of challenging levels. Can you beat the game?
This is the first game that I completed. If you create any of your own custom levels be sure to post a comment with the level code so others can try it! Read the rest of this entry »

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 3.8 out of 5)
Loading ... Loading ...

Update: What’s going on and about to happen

Alright, I haven't written anything here in a while and there is *sort* of  a reason for that. Recently I have been working really hard in developing my game framework, and finishing up some stuff. I have also been reading several books and trying to learn some new skills. Most likely over the next several days / weeks I will be blogging about some game stuff that I have put together. I'll be putting together some demos and tutorials for other flash developers to learn from what I have done.

Also, a friend and I have recently begun work on building a flash game portal website. We are trying to make it all web 2.0ish, in that it's going to have lot's of community features. I say *we* but well, right now it's more HIM building everything since hes the web genius hehe. I will be doing some more of the flash / promoting side of things.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

First week of fasting results and thoughts

Alright well it is day 7 of fasting and I feel fantastic! I decided that I would do a combination of water and juice fasting so that I could actually extend how long I fast. I read that I will get a pretty good detox on juice too, but that water is just much more aggressive with the detox. I purchased a juicer, and I am hoping it will be a good friend of mine for years to come as I will be doing juice fasts and making healthy foods from here on out. It is very exciting to see how this is making such a strong impact on my life.

Compared to my previous attempt at "abstaining" from something where a friend Paul and I just ate fish / fruit / water for about 20+ days (we broke before 30 days), I can actually say this has been easier, less work on my part. The thing I have noticed from these type of trials though is that it really gives you a lot of perspective on life, and a lot of discipline towards many other things. I believe that in my journey now to find discipline, god has been sending me answers…and this being one of the big ones. It's actually funny now to think about it. For a long time I was searching for energy and motivation, and I was finally given the answer through me quitting my life as a Cutco salesman and starting into the world of online business….programming, blogging, etc.. Read the rest of this entry »

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

How to get started with losing weight and getting healthy

I was recently asked for some advice on getting healthy / losing weight. After giving it some thought, I realized I had a pretty simple answer...so here it is: Read the rest of this entry »

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

My biggest mistake with polyphasic sleep

Alright, so a couple of weeks back I decided I would attempt polyphasic sleep. The hardest part is getting past the initial 7-10 day adaptation period. One of the biggest problems with people who are attempting to do this, is that they oversleep which basically screws up the whole thing and extends how long it takes to adapt. Well, unfortunately for me, I have still not fully adapted to polyphasic sleep, because I keep oversleeping every 2-3 days. This has been starting to get very frustrating, as I have been pretty unproductive for the last 3 weeks or so, simply due to the fact that I am too tired to really do any brain intensive task.

What I have come to realize after oversleeping yet again last night... Read the rest of this entry »

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...