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:

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.

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.
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.
Subscribe to:
Posts (Atom)