Our Flash tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website.  Home Flash & Swish Flash Tutorials First Person Games
Your Ad Here

First Person Games

Browse Pages: << < 1  2  3  4  5  > >>

Ok, this is the next installment in the first person shooter tutorial. In the last one, you should have made a hand holding a gun, with the cross hair (or sights) moving around with the mouse. Not much fun shooting at a blank screen is it? Anyway now we will be working towards preparing the game for some enemies to shoot.

We will prepare the background and hiding places for the enemies in this tutorial.

To begin, open up the previous fla and add these layers to the movie (keep the order):

Now we could just put everything in one layer, but using different layers for different object keeps things neater and makes troubleshooting and editing easier. Besides, the amount of layers you have does not affect the final size of the movie.

The layers "garbage cans" and "wall" are coverings I've used, that the enemies hide behind. You can use your own.

In the wall layer, click on the first frame and draw a wall or a fence, again, it's up to you:

image 1

In the ground layer, click in the first frame and draw some ground, or grass. I used a gravel tile image and just duplicated it, then grouped the duplicates together. Tip: if you select an image, press CTRL+K (this brings up the Align panel) then click on:

image 2

1: Align centre stage horizontally then

2: Match stage width

image 3

This aligns the image to the centre, then makes it the same width as the stage so you don't have to worry about matching the size. The only thing you need to adjust is the height of the image. Be careful though, as if it's a small image, it may become distorted. You should end up with something like this:

In the garbage cans layer, click in the first frame and draw two garbage cans - or whatever covering you've chosen. Place into position. Once they're in position, click on one of them and press F-8 - Convert to Symbol and select Button. Give it the name "garbageCan1":

image 4

Do the same for the other one, but give it the name "garbageCan2".

image 5

These buttons won't be used in the movie as buttons, it's to stop anything, namely the enemies being shot while they are hiding behind the cans. If you click on the garbage can, around the same area that the enemy is hiding, he would still react as if he has been shot, even though you haven't actually clicked on him, and even though he is not visible. Now we could just simply use, when the character is hidden, a variable like isUp = false to tell us he is not up and can't be shot, or:

this.enabled = false;

which would prevent him from being shot before we want him to be, and when he is fully up and out of the hiding place use:

this.enabled = true;

which would enable him to be shot, but it's more realistic if he can be shot even if a bit of him is visible, whether he is fully up or not. By placing an inactive button in front of him, it forms a layer or barrier, that if clicked on the area the enemy is hiding, the shot won't register with the enemy. The shot will register only if you actually click on the enemy. If this sounds confusing, hopefully you'll understand as you put it into practice.

Now you should have the wall, the ground and the garbage cans all done. I used pre-made graphics for the wall, ground and garbage cans, just to make things easier writing the tutorial. You may want to spend some time, drawing a background you're happy with.

In the next part, we hope to add some enemies into the picture so you should have something to shoot at.



Author's URL: Sajid
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
Browse Pages: << < 1  2  3  4  5  > >>
print this page subscribe to newsletter subscribe to rss

Internet & computing Flash is a vector-based moving graphics format created by Macromedia for the publication of animations on the World Wide Web. More Flash & Swish: Most Popular Materials | Fresh Materials | More Flash Tutorials at FlashPerfection.com

Add comments to "First Person Games"

Only registered users can write comment

Reader's comments
comments sethdd October 02, 2008 says:
First Person Games
Ok the problem i am having with this is... i have completed pretty much everything on part 1, and part 2, but the thing is i am still able to shoot threw the trash can, and the aimer doesnt really stay with the mouse... its way off the mouse... because when i try aiming with the sight, and shoot the guy it does nothing...but when i aim with my gun, it kills him. so the sight is off, and its off to the left how do i fix these problems i am having?
comments randomqaz August 21, 2008 says:
First Person Games
I have fixed the problem!

My center thing was not in the center.
comments britto November 21, 2006 says:
First Person Games
Your Tutorial First Person Games is Excellent. One Request is If u put some preview it will be more useful. i also have one suggestion for each tutorial there should be a corresponding SWF file which can be downloadble. If u meet this requirements it will be very useful For students like us. I would Like to appreciate your Site was Very Good and Very useful.

Thanks,
Britto,