Archive for November, 2010


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

Advertisements

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))
{
DO SOMETHING
}

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:

https://github.com/skyboy/AS3-Utilities/tree/master/skyboy/

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:

Key.listen(stage)

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

if (Key.isDown(Key.WHATEVERKEYYOUWANT))
{

PERFORM A SPECIFIC ACTION
}

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.

(more…)