AS3: Button Mashing Game
You may or may not recall, a long time ago, I wrote a tutorial on how you could create a button mashing game in AS2. (Yes, I also promised more parts to it and didn't deliver, eep!) And a little while ago, someone commented asking for an AS3 conversion.
Now, I'm still not confident enough with AS3 to go writing game engine tutorials with it, so I leapt over to the forum and asked if anyone there would take on the challenge.
Luckily for me, HiddenSpartan did, and has very nicely allowed me to post it up here on the blog.
You can grab the source at HiddenSpartan's DeviantART page, here, or download it from FH, here. Remember to give credit if you use it!
AS3: Avoiding Game Part 4
Blimey, MichaelJWilliam's is writing these quickly, Part 4, the latest in his AS2 to AS3 translation of the avoiding game tutorial series here at FrozenHaddock is now out, and ready to be followed. Go check it out!
I'm going to have to write the AS2 ones a little faster aren't I?
Adding subtitles to an animation
Recently, I was asked by a friend of mine how to add subtitles to his animations.
Thus, I present to you, featuring the amazing voice talents of a certain Martin, a little fla (Flash 8) that has a basic subtitle system laid out.
Enjoy.
See more of Martin at Newgrounds.
How to create a Simple Maze game (Preview)
So yeah, I'm being lazy. I know, I know. I'm partway through writing Avoiding Game pt3, so there! I am doing something! Just... not much. So here's a quick engine for you to play around with while I write up a tutorial to go alongside it. If you have anything you'd like to add, comment and I'll see what I can do.
Click here to play that thar simple mouse avoider maze related game!
And clicky here to grab the source.
Have a play and see what you can come up with, and keep poking me to write the tutorial. You know I'll forget!
How to make a simple Avoiding game
The avoiding game tutorial series:
Part 1 Part 2 Part 3 Part 4 Part 5 Part 5b
FrozenHaddock Tutorials: Simple Avoiding Game
In this tutorial you will learn how to create a simple dodge game, this will help learn about hittesting, whilst allowing new flash developers to get a quick and easy game.
You will be making a game like this;
The first thing we will do is set up our flash document. I'm setting mine up as 300x300px, 24fps and I've chosen grey as a background colour. You can choose different dimensions, but you will have to change the actionscript to reflect that.
Now we need to setup our character. Draw your character onstage and convert it to a movie clip (F8). Name it accordingly and make sure the registration point is in the centre. Then open up the properties bar for your player and set the instance name to player.

Now, open the character's actions panel and give it these actions;
-
onClipEvent(enterFrame){
-
Mouse.hide();//hides the mouse
-
this._x=_root._xmouse;//sets the x of the player to the x of the mouse
-
this._y=_root._ymouse;//sets the y of the player to the y of the mouse
-
}
Now test your movie, the player mc will now follow the mouse, good. So lets move onto some enemies.
Draw your enemy on the stage, and convert this to a movie clip. As with the character name it accordingly and set the registration point to the centre.
Open up the actions panel for your enemy and add these actions;
-
onClipEvent (load) {
-
this._x = random(300);//sets the horizontal position randomly
-
this._y = random(-50);//sets the y position above the stage
-
speed = random(5)+1;//sets the speed randomly
-
}
-
onClipEvent (enterFrame) {
-
this._y += speed;//moves the enemy downwards
-
if (this.hitTest(_root.player)) {//if the enemy hits the player
-
_root.gotoAndStop(2);//goto the second frame, which will be a gameover screen
-
}
-
if (this._y>=310) {//if the player reaches 10 pixels below the stage
-
this._x = random(300);//randomly set the x, y and speed again.
-
this._y = random(-50);
-
speed = random(5)+1;
-
}
-
}
Test your movie now, and see your enemy fall down the stage. You can copy and paste this enemy for multiple enemies.
Now, before we setup a game over screen, we'll setup a timer. (For a more indepth tutorial on creating this, see here)
Draw anything, and convert it to a movie clip. Move it off the stage.
Now, double click this to get inside the mc, and add a frame in at 24, or whatever value you set your fps at. open the actions of this frame and enter;
_root.clock+=1;
Double click anywhere to return to the main timeline, and click on your frame. Add these actions in;
-
stop();
-
clock=0
Right, so now the clock is timing, we need a way to see it. Use the text tool to add a new text box onstage. Open the properties bar for this text box, and change the drop down menu from 'static' to 'dynamic'
Then, keeping the bar open, change the var: input box to clock
Test your movie, you'll see the clock time as you play.
Right, now for the game over screen, giving users their time and an option to replay.
Add a new blank keyframe on the main timeline. On this new frame setup the way you want it to look. Make sure to copy the dynamic textbox from the other frame wherever you want your players time to show. I have this;
(NOTE: I just realised, you'll want to put Mouse.show(); on the frame here so you can actually click your button.)
Of course, we need to give our players the option to play the game again, so we need to setup a button. More information on setting up a button can be found on the site.
The actions we want on this button are these;
-
on(release){
-
gotoAndStop(1);
-
}
Now test your movie, and play your fully functioning avoision game!
If you learn more about hittests and variables, you will be able to setup scoring and powerups etc. But that's for you to learn yourself!
Remember, post your creations on the Forum!
Ballpusher concept
Heres a game concept I came up with, no tutorial but if you want one I'll do it.
download the source file and see what you can do!
(Oh yes, and it was featured on Emanuele Feronato, so I must be doing something right!)
![[del.icio.us]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/digg.png)
![[Google]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/linkedin.png)
![[StumbleUpon]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Windows Live]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://frozenhaddock.co.uk/wp-content/plugins/bookmarkify/email.png)
