We have moved…. Again!

Posted: July 7, 2011 in Uncategorized

Here is the new site we have joined https://sprunnerstudio.wordpress.com/

The Blog Reanimated!

Posted: June 29, 2011 in Uncategorized

WOO! I shall reinvigorate this blog by posting actual stuff WOO!

Programmer’s Manifesto

1. I will help those who are willing to learn.

2. I will not waste my time trying to help those that will not put in the effort to learn the newer, harder, more efficient way.

3. I am not bound by law to answer your forum posts within thirty minutes of you asking the question.

4. I am willing to learn a harder thing if it helps my knowledge.

5. I will not waste my time if you can’t be bothered to post readable code (Learn 2 )

6. I will not waste my time if you can’t be bothered to figure out which line of code is the issue and instead posted all 200 lines of your class.

7. I am not psychic and will not open your thread if it does not have a meaningful title related to the issue. I.e. “I need help” is not meaningful.

8. I am the first of things to be wrong. If something bad happens, I’m the first cause to check.

9. I will follow my gut feeling. If the code feels wrong, or smells, then I will attempt to change it to the best of my abilities.

10. I will attempt to read a book or part thereof, or attempt a new challenge in a field of expertise to improve my knowledge and ability atleast once a week.

11. I will try my best to write high quality code the first time. Improving it as I learn more or as needed.

12. I will make every attempt to finish what I start, and give up only if it proves futile or fruitless.

13. I will only use one code convention for a project, and I will change any code that doesn’t match the code convention to match the code convention.

14. I will not waste my time if your code uses lots of arbitrary, non descriptive variable names.

15. I have my own personal life to take care of before I help you.

16. I will not answer to those who tell me what effect they want, expecting someone to do it for them, before they try to write the code and figure it out themselves.

17. I will try to help those who use correct grammar and punctuation in my posts.

18. I will not refer people to a trial of a popular-but-expensive proprietary tool when a viable alternative exists.

19. I will always practice the meaningful use of whitespace and indentation, and I will learn to comment my code in a useful way. Code that cannot be read easily and understood quickly is useless, and I should not expect help with it.

20. I will learn how to use the edit button and how to properly format code before I post it on any forum on the internet.

21. I will always support beginners who try to learn, I will always scold beginners who try to teach.

22. I will not overlook the importance of planning how my code should be structured.

23. I will set goals that are ambitious, but reachable.

24. My first game will not be an MMO. Pong or Tetris is fine.

25. My first game should be pong or tetris or bejeweled. Something that’s simple and there exists hundreds of tutorials on.

26. Unless I have the language completley mastered, I will always have the language reference ready for lookup.

27. I will explain any help I give to a beginner and in turn teach them rather than only providing the answer.

28. I will never assume I can remember every single intricate detail about any language because there are too many and human memory is flawed.

29. If I take up programming in any language I should also attempt to learn more languages after I have mastered the language I started with.

30. I understand the learning a programming language takes time and real effort. I will devote my time into learning, and not give up.


A few weeks ago I interviewed Michael James Williams of AS3 Beginner Tutorial fame.

1. What was the first time you remember using a computer? :

I remember my Dad had this laptop, as thick as a brick with a tiny tiny screen, with Windows 3.1 in black and white. But I have better memories of my own first computer: an Amiga 600. I wrote my first code on that machine, in AMOS which was a feature-rich version of BASIC. I used to edit the code of the sample games that came with it to help me understand how it all fit together. Well, OK, no — it was so that I could get infinite lives on Dithell’s Wonderland.

2. How did you discover you wanted to program? :

My interest was piqued by AMOS, and my Dad taught me a lot to get me started, but I think the point I really got into it was when I was about 11, when a friend and I discovered a version of BASIC on the school’s Acorn computers. The teacher let us mess about with that instead of whatever we were supposed to be doing in class. In retrospect, that was pretty cool of her.

3. What was the first computer language you learned? :

The summer after finding BASIC on the school computers was when I really started getting into programming, and I started with yet another version of BASIC: QBASIC. This was super-cool because (if you had the right version) you could use it to make EXE files, just like real software. How exciting!

People say that if you start with BASIC it’ll cripple you as a programmer for life. Maybe I would have a different coding style today — maybe I’d be a better coder — if I’d started with another language. I don’t know. But BASIC was fun, and I don’t regret starting with it. If I were starting today I’d probably spend hours or days reading a million different forums trying to figure out which was the One True Beginner’s Language to start with, and would likely never get into it.

4. When/Why did you start using Flash? :

My family had a copy of Flash 5 when I was about 12, and I really liked it as a drawing tool. It was nowhere near as powerful as, say, Illustrator or FreeHand, but I didn’t have Illustrator or FreeHand; I had Flash and MS Paint. I used Flash to draw almost every diagram for every piece of schoolwork, right through university.

I played around with the animation tools as well, but didn’t do anything mind-blowing: I put people’s heads on stick figures and made them do silly things, and I made a few of the types of tacky website intros that Flash was infamous for.

Funnily enough I never enjoyed Flash coding (with AS1, as it was at the time). With even the simplest tasks, I could never get Flash to do what I wanted. It’s probably because I learnt to program with BASIC.

5. When/Why did you start technical writing?

When I was studying, I wrote my revision notes in the same way that I now write tutorials, and I would give people a hand by explaining concepts on those “revision help” forums. When I was at university I took a module on scientific writing in different contexts — magazine articles, student factsheets, research papers, and so on — and found that I rather enjoyed it.

I didn’t really get started until I was trying to learn AS3, though. At the time, it was still a fairly new language, and there weren’t many tutorials aimed at my level; everything seemed to be written for either complete programming beginners or long-term AS2 experts. So I thought, heck, I can do better than that.

6. Did you ever imagine that you would be doing this for a living?

Not at first, because it was just a hobby. But once I realised that it was what I wanted to do, yeah, I thought I could make a living from it.

7. With Apple and their stand against flash, do you see any danger of it actually going away?

I don’t believe Flash will disappear, but I do believe that we’ll see a radical change in what it’s used for. We’ll see less Flash banner ads and full-Flash websites, for a start. Personally, I’m not too broken up about that.

8. Do you have any advice for people learning to program?

Stick with it. I knew a guy who wanted to learn to program; he started with Java, because it was multi-platform, but after a few days he switched to C++, because he read that it’s used in most programming industries, and then he moved to Python, because he heard it had a much friendlier syntax for beginners, and then, well, he never got anywhere with it.

Don’t worry about whether you’re learning the best language in the world; there’s no such thing. Don’t worry about whether the first language you learn will be immediately relevant to the industry; once you’ve learnt all the basics, it won’t be difficult to switch if you need to. And definitely don’t decide that your first task should be to assemble a group of artists, designers, and sound engineers so that you can build an amazing MMORPG; start with some entertaining little problems that you could do yourself over a weekend.

9. camelCase or underscore?

Depends. I’ve been doing a series of posts on this, actually 🙂

10. What is one of your favorite things to do in your spare time?

I cook a lot. This is a great hobby to have, because it leads to food. And I do enjoy eating.

11. What is the best movie ever?

It is always a draw between Terminator 2 and Harvey.

12. What is the best programming related blog?*

Definitely yours.

*Please note that I didn’t actually ask him this because toward the end of the interview he was kidnapped from my leather couch by Middle-Aged Mutant Ninja Turtles.(But I am sure he agrees with me :))

Here’s a list in no particular order :

Ease of use : Most players aren’t going to read the help section to figure out how to activate that special key. (See Next Item)

Easy Learning Curve: As you progress in the game, tool tips pop up to show what that little lever does and whether or not to trust the little elf.

Illusion of Choice: Players love to think the are outsmarting the programmer when really no matter what they do ends in the same result.

Easy Controls: When I play a game I don’t want to have to read a ten-page account on the different key’s and what they do.

Lack of Bugs: Any small problems and any illusion of a seamless(professional) game is instantly shattered.

Achievments: Pull handle receive cookie. Players love the feeling that they are actually accomplishing something and not just wasting a valuable day at work.

Pretty Graphics: If a player sees an ugly platform or cliff,  the illusion of a big important programmer high up in the sky is shattered, and the realization of an smelly middle-aged man is discovered.

Special Effects:  When I see a tremor in the screen when I shoot that enemy or I see a flash of red when my spaceship is hit I assume a ton of work and effort went into the game

High Scores : Competition is what makes baseball, football, and Super Smash Bros. fun. Flash games are no different.

Upgrades: What would a Tower-Defense be without the ability to upgrade that water tower? Boring.

Many Custom Items: (See Above)

Illusion of cleverness: People love to feel smart. Just look at a game like Doodle God . It is nothing more than clicking two different labeled blocks until ou stumble upon a pretty animation revealing yet another pretty block. Rinse, Repeat.

Likable Anti-Hero : Examine Portal, without GLaDOS, this would be a very boring game.

***Sponsor Logo*** :  This one might be controversial, but look at a game like Epic Combo. Without Armor Games logo on the beginning of it, I feel peoples opinions would be quite different.

Style: Know what you plan to make before you start writing a game! I have seen so many games that are like sponges. On one level the art is beautiful, yet on the next it looks like cartoon-art, and on the next it looks like steam-punk.

Good Sound FX: Immerse the player in seamless sound effects. Make them forget that PS3 or 360 in the corner.

Flawless Spelling/Grammar : (See above )

That’s part 1 folks. I would love to get peoples reactions below. 🙂

There are some lesser known functions in the Key class. I plan on going thru them one by one until it is clear of what and how they work. The first we will examine is anyDown(). This function is for checking whether -you guessed it- any keys are down! YAY!!! The way this works is as follows:

It analyzes  the sector in which the keyboard is in your webcams camera and then looks to see if the pressure traces on the key is visible. JK, it is much simpler than that. Let’s look at the code :

<blockquote>public static function anyDown(code1:int, ...codes):Boolean {

if (code1 >= 0 && code1 <= 1048575) {
if (Keys[code1]) return true ;

for each (var code:int in codes) {
if (code >= 0 && code <= 1048575) {
if (Keys[codeKey]) return true; *


Let’s go line by line:

if (code1 >= 0 && code1 <= 1048575) {

(This checks if  code1 is bigger or equal to 0 and smaller or equal to 1048575. Please note that code1 WILL be within that range if any keys are pressed.)

if (Keys[code1]) return true ;}

This checks if (Keys[code1]) is down. If it is, anyDown will be true;

for each (var code:int in codes) {
if (code >= 0 && code <= 1048575) {
if (Keys[codeKey])) return true; *

This little chunk checks if any keys are down. If they are, anyDown will be true

Here is the usage:

if ( Key.anyDown(Key.A, Key.S))

I hope this has helped you to understand the way anyDown works.
Write in the comments below any Comments/Suggestions!

As a developer almost all games will require some form of key control. And after making a few games I can guarantee that you will become tired of adding event listeners and booleans for each key that is needed.  I have gone thru many sad custom key classes and have discovered that the best key class is…. Skyboy’s!

Skyboy’s Key Class is easy to set up and even easier to use. Download  it below and extract it to the desktop:


After it has been downloaded and extracted, make a folder on the C drive. Call it “Custom Classes”. Drag the folder you downloaded to the Custom Classes folder. After that, launch Flash Develop and go to the project window.

On the right hand side of your screen you should see a project manager pane. Right click on your project and select Properties > Classpaths > Edit Global Classpaths . Push the add classpaths button and add “C:\Custom Classes” .

Congratulations! You have made it easy to add custom classes in the future!

Now to implement the Custom Class.

First you need to import it at the top of your main class:

import skyboy.ui.Key;

In the main class function add the following to have the class listen for keypresses:


Now whenever you want to have an action for a specific keypress just add the following to the function of your choice:



That’s it! Simple wasn’t it?

A slight introduction

Posted: November 17, 2010 in Uncategorized

Welcome to my humble programming abode. With this blog I hope to help some people starting out programming. I will write mostly about AS3 (Action Script 3) but may diverge from it to talk about other shennanagins. Any comments, tips, or suggestions on what to talk about are welcome.

Downloading and setting up FlashDevelop:

For those learning AS3, the biggest initial thing they need is a IDE (Integrated Development Environment). This will be the program they use to code projects. The general consensus is that a program called FlashDevelop is the best for this. Download the latest version from here and install it. Check the box that gives you the option to install the flex sdk. If all goes well you should now have FD all set up and rearing to go.

Read the rest of this entry »