Friday 13 December 2013

Variables.. What are they?

Variables are an extremely important part of programming almost any game. A variable is basically a container that stores a value that you've set to it. Think of them as labeled jars, you can store data in them such as numbers or letters and to read this information again all you need to do is write the label on the jar. Variables can be changed by doing calculations to the variable name. Say, if you had a variable called 'Money' you can then set this to 200 by writing Money = 200. Then if you read the variable  'money' at anytime it will give you the value stored in the 'money' variable.
In actionscript there are 3 main variable types these include:

  • Numbers - Pretty obviously these store any number value.
  • Stings - These are used to store words/letters.
  • Boolean - These store only true or false.
Variables can come in more then these 3 varieties however most variables used will fall under these common types.

In most cases variables will only remember their set value till the game is ended, then any value stored will be lost. This is why in many games the values of every variable are saved to a file so that when you open the game again all the variables will load their values from the file.

Thursday 12 December 2013

Vector image experiments..

Vector art is much different than pixel art in that vector images use mostly simple shapes that have been gradient filled. This gives them a much clearer look and they can be dramatically zoomed without loosing quality. 

No prizes for guessing which ones are the pixel art and which are the vector.
With the pixel art on the left you can actually see the individual pixels that are drawn to create the picture. With the vector images on the right the colors are all smoothed out into different shapes to create the image. 

I have discovered a great software that's really good for creating vector images with. The program is called Inkscape and its really easy to install. 


Best part is the inkscape website has a whole bunch of great tutorials, that even I can follow! Here are links to some of my favorites: 

I've given a number of the tutorials a go and here is what I've made so far:

A fabulous rocket ship
A delicious coffee 
Some sort of mutant alien..
Ok, fine you're not going to go from a artistic disgrace to a Picasso in one day, but its a good skill to have and I've found it's actually an incredibly fun thing to do :) 

Tuesday 10 December 2013

Installing FlashDevelop and Creating Very First Program

Flash develop is a great program to develop flash games with, its free, fun and relatively easy to use. In this tutorial I'll show you every thing you have to do to setup Flash develop and start creating your very own games in AS3.

1: Downloading FlashDevelop
First of all we need to download and install Flash develop and get it setup and running on your computer.
To do this go over to the FlashDevelop website and press the big green 'Download' button to the right side of the screen to download the latest version.

Yep that's the one ^

2: Installing FlashDevelop
Now that you've successfully downloaded the latest FlashDevelop installer and located the file (Probably in 'Downloads' folder). Click on it and just follow through the installer using the default installation options. Make sure you agree to install Flex SDK (needed for compiling) and ActiveX Debug Flash Player (needed for debugging).

Now if you've done this successfully you should have FlashDevelop ready to run on your computer. 

3:Testing FlashDevelop
Now that we've installed FlashDevelop all that's left to do is to write a simple 'Hello World' program to test it.  Click on the freshly installed FlashDevelop and once that's open press Project  New Project 

This should open a 'New Project' window, select AS3 Project from the list of installed template options. Now give your project a name and choose a destination for your project files. If you want a new folder to store all your project files tick 'create directory for project'. You can leave the 'Package' field empty. 

Choose these settings for you project, but use your own file location.

Now that you've chosen these settings press 'OK' and your project will now be constructed. 


On the side panel you'll notice a bunch of folders and files, click on the src folder and then open the Main.as file. This is the ActionScript file for the main class and is the first object to be created when you run the game so this is where you program all the starting code. In this test project we will be focusing solely on this class. 

Opening up this Actionscript file we see a number of default lines of codes that have already been written by the program:

This is mostly unnecessary code and can be shortened to: 


Now we will use our very first piece of written code. We are going to use the actionscript function called trace() which is used to send anything within the brackets to the debugger. We will tell our program to trace the string 'Hello World!' to the output console. To do that you write:

Notice the " between the words and the brackets. These are important as they tell the program that this is just a made up set of words, not an actual variable. 

Now to test your program hit Project  Test Project (or just push f5). Your project should open up and you should be able to see 'Hello World!' in the output box down the bottom of the screen.


Yay its working!

If you see this then yay! Its working. If this doesn't work leave a comment below and I'll try and get back to you as soon as I can. 

Monday 9 December 2013

Home Page

I've decided to create my very first blog because I want to share some of the programming tips and tricks I've discovered over the years and hopefully you might actually learn a thing or two ;)

Most of the tutorials in this blog will be directed at programming with Flash develop which is a free, open source, program that allows you to create flash games written in action script 3 (AS3)


If you need help downloading and installing this program please visit this page: installation instructions

Advertisement: