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.
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.
No comments:
Post a Comment