Advance Notice - Wednesday 28 February 2007

There will be no club on Wednesday 28 February due to other commitments by the pupils involved.

See you on 7 March.

Session 3 - Wednesday 14 February 2007

Well it was Valentine's Day today, so the pupils must love coming to this club because we had a full house for this session. Last week we created a spaceship which could be moved with the arrow keys on the keyboard, a vertically scrolling starfield, some falling asteroids and we also kept a score of how many falling asteroids were avoided.

In this session we decided to create a new side scrolling space shoot-em-up game with a mother spaceship and laser cannon and several enemy spaceships. The game will also have a side scrolling landscape and starfield, with a score being kept for each enemy shot down.

As graphics take quite a long time to draw, we started this session by importing some graphics from the internet to use in our game. We chose a spaceship, laser beams and an enemy spaceship and these were loaded into our Flash library as bitmaps. We changed the colour of the stage to black and then dragged the mother spaceship from the library on to the stage. As it was a bit large, we scaled it down in size. Then we made it a movie clip symbol and added some actionscript to move it around with the arrow keys, much the same as in the previous game.

Next we added a new layer for the laser beams and dragged the laser beam bitmap onto the stage. Again, we made it a symbol and then added some actionscript to duplicate it (for lots of laser beams) and fire it across the screen whenever the keyboard CRTL key was pressed.

There were lots of mistakes in the actionscript when the game was tested, so much of the evening was spent debugging the code. One things the pupils have learnt is that you have to be very accurate when typing code in - any mistakes in punctuation (syntax), spelling or capital letters cause errors in the program, and then it doesn't run correctly. Not surprisingly the pupils are getting very good at spotting errors too!

By the end of the session we had the beginnings of a very nice looking game with a keyboard controlled spaceship and a laser cannon firing laser beams across the screen. Here's a screenshot of what we did:

Next week we'll be adding a side-scrolling landscape and a second scrolling starfield giving a 'parallax' effect which gives the game the appearance of depth.

Come back soon to see what happened!

Mr. J.

Session 2 - Wednesday 7 February 2007

Well this week only Lee showed up, but we decided to go head with the session anyway. In the last session we drew a rectangle and added some actionscript to move it around the screen using the keyboard arrow keys. We then added a circle shape and added some actionscript to test if the rectangle touched it as it was moved around.

The aim of this session was to turn our rectangle into a spaceship, add a scrolling starfield, add a asteroid which 'falls' down the screen and keep a score of all the asteroids avoided. The aim of the game we are developing is to avoid the falling asteroids - one point should be awarded for every asteroid avoided.

We started with the spaceship. Lee opened his rectangle symbol and added three triangles to it - one for the nose cone and the other two for fins or wings. He then opened his asteroid symbol and added some more circle shapes to it to make a more realistic looking and irregular asteroid. Some extra actionscript code was added to the asteroid movie clip to make it repeatedly 'fall' down the screen. Here's a screenshot of the rocket:


Lee then tested his game to see if it worked - the spaceship moved left, right, up and down and the asteroids fell down the screen. If one hit the spaceship, the 'You have crashed!' screen appeared and the game ended. Everything as it should be so far.

To add the scrolling starfield, Lee created a new movie clip by drawing a black backgound and painting some white blobs all over it for stars. Then he copied it to make the starfield twice the size. Some actionscript code was added to the movie clip to make it move down the screen five pixels at a time. When the background reaches the bottom of the screen, it jumps back to the top again and repeats the movement. This is done so quickly and smoothly that it gives the appearance that the starfield is continuously scrolling.

A new layer was added to the timeline and named 'backgound'. The starfield movie clip was added to this layer and the layer was dragged to the bottom of the layer stack so that it appeared behind everything else. When this layer was tested it didn't work first time, and it took several goes to debug the code and make it work - but when it was working it looked great!
We then added a new layer with a dynamic text box to display the score - one point for each asteroid which reaches the bottom of the screen without hitting the spaceship (in other words, the spaceship has been moved out of the way by the player, thus avoiding contact with the asteroid). A variable called 'score' was used to hold the score value, and some actionscript was added to increase the variable value by one every time an asteroid reached the bottom of the screen. The value of the score variable was displayed in the dynamic text box in the top right hand corner of the screen.

Lee then experimented for a while with changing the speed of the falling asteroids to make the game more challenging, and at times, impossible! This was done by making the asteroid move more pixels at at time. He settled on an _y value of 15 pixels which was challenging but achievable.

The last part of this evening's session was spent experimenting on how to add more falling asteroids to make the game more interesting. We want to have several asteroids of different sizes randomly spread out over the screen and falling at different speeds. One idea of copying the existing asteroid movie clip and it's code was tried, but this resulted in them all falling at the same speed and so it did not look very good. This obviously needs more thought and work! Here's a screenshot of the final version created tonight:



Phew! - we really got though a lot tonight, and much progress and understanding took place. Let's see what Lee comes up with for next week's meeting.

Mr. J.

Wednesday 31st January 2007

There was no club meeting this week because two of the founder members (Danyal and Joshua) were out of school on another event. Lee turned up but we decided by mutual agreement to postpone the meeting so that the others would not miss out.

See you all next week.

Mr. J

Session 1 - Flash Games Programming - Wednesday 24 January 2007

Tonight we held the first taster session for programming computer games using MacroMedia Flash MX 2004. Three out of the six Year 10 pupils invited turned up - Danyal Prout, Joshua Close and Lee Clayton. The aim of this session was to introduce the pupils to MacroMedia Flash, to do some simple keyboard control for moving a graphic around the screen, and then to check for collisions with another object.

The pupils started by looking at the Flash interface which is divided into the menu bar, toolbox, property inspector and various other side panels. When a new document was created the movie timeline and white area known as the 'stage' was displayed.

The pupils then drew a simple rectangle shape and turned it into a movie clip symbol. Next they added a simple piece of ActionScript to the movie clip which checked if the up arrow key was being pressed. The ActionScript moved the rectangle shape 10 pixels upwards when the up arrow was pressed. The pupils then added more code to check if the other arrow keys were being pressed and then to move the rectangle accordingly.

Everyone was really pleased when they got their their code to work and they could move the rectangle anywhere on the screen by pressing the arrow keys - it even worked diagonally when two arrow keys were pressed!

The next task was to create an object to avoid - the pupils drew a circle shape on a new layer, made it a movie clip symbol and then attached some ActionScript which checked for it being touched by the rectangle.

Finally they added a new frame to display the words 'Game Over' when the circle was touched. Again there were squeals of delight when they got the code to work.

All in all, this first taster session went very well, and the pupils really seemed to be pleased with what they had done and learnt. Daniel even said he would swap his XBox for a PC with Flash MX 2004 on it!

Next session we'll be turning our rectangle into a spaceship, limiting how far the spaceship can move across the screen, adding more objects to avoid in the form of falling asteroids and creating a scrolling starfield background if time permits!

Come back soon and see what happened.

Mr. J.

Hello World!

Coming January 2006

This will be the online home of the WHS Computer Games Programming Club. This club will be set up as part of our ICT enrichment program for Gifted and Talented pupils. Computer games programming requires a good grasp of maths, spelling and punctuation, as well as the ability to create graphics on a computer. A logical mind, perserverance and the willingness to experiment are also vital to succesful programming. We'll see how many make it to the end after the first six-week session!

The starting group of six pupils will be learning how to program a simple computer game in Macromedia Flash, just like many of the online games available on the internet today. They'll be learning how to draw graphics in Flash and how to animate these using the Flash programming language called 'actionscript'.

We will be keeping a journal here which will show examples of what they have done after each session. By the end of the six weeks the pupils should have a finished a fully working Flash game that will be available here to play. If they really take to it, some may even become games programmers in the future.

Come back later to see who's in the club and the progress they're making.