Tutorial: Make a Vertical Shooter in AS2


Written By MrSun at 8:01 am - Saturday, January 17th, 2009
Categories: Flash

Step 1: Programming the Character

Today, we’re going to make a classic vertical shooter game in ActionScript 2. I hope you learn from it! Let us begin.

The first thing that I’m going to do is make the background of my game black, so it looks more retro. Then, we’re going to have to make the frame rate faster, mine will be 24 fps. Also, this will be a vertical shooter, so we probably should make the playing screen more narrow. My new dimensions are at 300×400 pixels.

Next, we’re going to draw a character. Mine will be simple, just a triangle pointing upwards.
My character
The dimensions for it are 30×35 pixels.

Then, we’re going to turn it into a symbol. After that, we’re going to give it an instance name of mcMain for main character. We will need this so we can reference the guy later. Now we’re ready to code this sucker. Make a new layer called “actions” and add the following code:

var mainSpeed:Number = 5;//how fast the main guy can move

onEnterFrame = function(){ //this function will run every frame (needed for moving the character
	if(Key.isDown(37) || Key.isDown(65)){ //if the "A" key or Left Arrow Key is Down
		mcMain._x -= mainSpeed;//then the move the guy left
	}
	if (Key.isDown(38) || Key.isDown(87)){//if the "W" key or Up Arrow Key is Down
		mcMain._y -= mainSpeed; //then move the guy up
	}
	if(Key.isDown(39) || Key.isDown(68)){//if the "D" key or Right Arrow Key is Down
		mcMain._x += mainSpeed; //then move the guy to the right
	}
	if(Key.isDown(40) || Key.isDown(83)){//if the "S" key or Down Arrow Key is Down
		mcMain._y += mainSpeed; //then move the guy down
	}

	//keeping the main character within bounds
	if(mcMain._x <= 0){
		mcMain._x += mainSpeed;
	}
	if(mcMain._y <= 0){
		mcMain._y += mainSpeed;
	}
	if(mcMain._x >= Stage.width - mcMain._width){
		mcMain._x -= mainSpeed;
	}
	if(mcMain._y >= Stage.height - mcMain._height){
		mcMain._y -= mainSpeed;
	}
}

This is actually all we need for this chapter. Pretty easy, right? Next time, we’ll make him shoot!

Final Product

Source .fla File

Read More...

What Makes a Viral Game?


Written By MrSun at 9:55 pm - Tuesday, January 13th, 2009
Categories: Uncategorized

You all those games, the kind that usually aren’t particularly good but are still somehow very popular. Those are what are know as viral games. Some are created to advertise a product or event. Others are just made to be funny. But, they all have some aspects that are special to these kind of games. I’m going to tell you the components of games like these.

Read More...

Link Post Sunday 01/11


Written By MrSun at 12:33 pm - Sunday, January 11th, 2009
Categories: Uncategorized

A collection of the best links I find throughout the weeks, covering topics such as Flash, Flex, Game Development, Humor, and Web Design.

Read More...

Tutorial: Create a Brick Breaker Game in AS2 – Part 6


Written By MrSun at 8:05 am - Saturday, January 10th, 2009
Categories: Beginner Tutorials, Flash

Table of Contents Coding Paddle Movement Programming the Ball Setting Up the Bricks on Stage Hit Testing the Bricks Creating Levels Finishing Touches Step 6: Finishing Touches Well, we’re almost done with our game, now we just have to add some finishing touches. I won’t make a menu system like you usually should in a […]

Read More...

Tutorial: Create a Brick Breaker Game in AS2 – Part 5


Written By MrSun at 8:04 am - Saturday, January 10th, 2009
Categories: Beginner Tutorials, Flash

Table of Contents Coding Paddle Movement Programming the Ball Setting Up the Bricks on Stage Hit Testing the Bricks Creating Levels Finishing Touches Step 5: Creating Levels Now that we’ve got the basic gameplay down, we can create some levels. Because we’re making only a simple game, we aren’t going to make that many. But […]

Read More...

Tutorial: Create a Brick Breaker Game in AS2 – Part 4


Written By MrSun at 8:03 am - Saturday, January 10th, 2009
Categories: Beginner Tutorials, Flash

Table of Contents Coding Paddle Movement Programming the Ball Setting Up the Bricks on Stage Hit Testing the Bricks Creating Levels Finishing Touches Step 4: Hit Testing the Bricks Now that we’ve actually made the bricks, we can now break them with our ball… Anyway, this will be pretty easy to accomplish. All you have […]

Read More...

Tutorial: Create a Brick Breaker Game in AS2 – Part 3


Written By MrSun at 8:02 am - Saturday, January 10th, 2009
Categories: Beginner Tutorials, Flash

Table of Contents Coding Paddle Movement Programming the Ball Setting Up the Bricks on Stage Hit Testing the Bricks Creating Levels Finishing Touches Step 3: Setting Up the Bricks on Stage Ok, we’ve got the paddle and the ball. Now, the only major thing left to program is the brick. This is also the hardest […]

Read More...

Tutorial: Create a Brick Breaker Game in AS2 – Part 2


Written By MrSun at 8:01 am - Saturday, January 10th, 2009
Categories: Beginner Tutorials, Flash

Table of Contents Coding Paddle Movement Programming the Ball Setting Up the Bricks on Stage Hit Testing the Bricks Creating Levels Finishing Touches Step 2: Programming the Ball The next obvious step in creating a brick breaker game is making the ball. So, I’m just going to make a small 10×10 pixel white circle into […]

Read More...

Tutorial: Create a Brick Breaker Game in AS2


Written By MrSun at 8:00 am - Saturday, January 10th, 2009
Categories: Beginner Tutorials, Flash

Table of Contents Coding Paddle Movement Programming the Ball Setting Up the Bricks on Stage Hit Testing the Bricks Creating Levels Finishing Touches Step 1: Coding Paddle Movement Alright, I’ve decided to make a tutorial for you guys on how to create a brick breaker game in ActionScript 2.0. It’ll be very similar to my […]

Read More...

Tutorial: Create a Game Like Winter Bells in AS3 – Part 5


Written By MrSun at 8:05 am - Wednesday, January 07th, 2009
Categories: Flash

Basic Character Programming Programming the “Bells” Level Creation Scoring Finishing Touches Step 5: Finishing Touches This part of tutorial is where we add some bug fixes and special effects. Let’s get started. The next bug we need to fix occurs after the mcFinalStats is shown on the screen. Whenever you click anywhere, mcMain can still […]

Read More...