Sunday, July 26, 2009

Actionscript 3.0 Soccer Game

Use the Mouse to move the lad, and make him kick or head-hit the ball.
Kicks deflect to the left, Headers deflect to the right.
If the ball hits the bottom of the screen, a life is lost. There are three lives.
There are 3 levels of soccer goal scoring to get through to win the game and "beat the computer".


There are a few issues with this online version of the Flash game:

1) We need to do refresh or reload in between restarts of the game, or the levels stop working.

2) The ball can get stuck going vertically up and down in the left or right boundaries of the screen. The only way to end this is to move the player away, and sacrifice lives until the game ends itself as a loss.

(Although this is not all bad. After all, it does add a suprise element to the game, via the random occurrence of this unlucky event.)

3) If we do not refresh the blog page between new games, all sorts of strange things happen with the levels, and sometimes the ball starts going faster and faster (to disaster !) as the game progresses.

These issues do not seem to occur on the SWF file when it is played locally on the PC here at home. If someone knows how to fix the online issues, I would be delighted to be enlightened.

This game is actually a "Paddle Ball" game, called "Break the Bricks" that I have changed into a soccer game.

The original Paddle Ball game was built by following the excellent multipart AS 3.0 tutorial at the "Mr Sun" Flash website:http://www.flashgametuts.com/
The following PDF document gives a detailed review of the build with quite a few extra hints and ideas. It also explains how Mr Sun's Paddle Ball game was converted into this Soccer Game.
The Links in the PDF to Mr Sun's site are out of date, and you can find his Brick Breaker Game that you need to build at this link: 


http://www.flashgametuts.com/tutorials/category/as3/


Also included is a step by step guide on how to put the finished Flash Game onto a website or Blog.


If you would like to have your own full size copy of this PDF, then simply click the save disk icon button on the PDF viewer, and you should be able to save it to your own hard disk.

Alternatively, you can view or save the full size PDF by clicking the link below:


Click here to open or save the “Build the Soccer Game” PDF

The following additional PDF provides a full listing of all of the Actionscript code that was used to make the Soccer Game:

If you would like to have your own full size copy of this PDF, then simply click the save disk icon button on the PDF viewer, and you should be able to save it to your own hard disk.

Alternatively, you can view or save the full size PDF by clicking the link below:


Click here to open or save “Soccer Game AS 3.0 Code” PDF



CREDITS:
Nearly all of the AS 3.0 code contained in this game came from Mr Sun’s excellent tutorial on making the “Brick Breaker” game, which can be found at this website:


http://www.flashgametuts.com/tutorials/category/as3/

I have merely put his code together and added a few changes and extra comments and explanations along the way.

Kenny Sun is the one who deserves the credit for the overall game structure and coding. His Blog is great for learning how to make Actionscript Games.
Do yourself a favor and check it out sometime soon !

He also has some great Tutorials to build some other games on his site.

Hopefully one day, if we keep doing enough tutorials, we will be able to design games, and write the complete Actionscript code ourselves :)

Enjoy,
Big Passy Wasabi


No comments:

Post a Comment