Mini Racing Written totally by BittenApple, 23/12/04 Tutorial accepted at pixel2life.com // If you like the tutorial.. PLEASE REGISTER Download files here: http://imusion.net/tutorials/flash/flashtut5/tutorial_bittenapple.zip People show you how to make your car move, or a car with boundarys - but you may wonder how to make your own mini-game.. good animaters will find the CPU part alot easier by the way. Follow these easy steps to make your own racing game! A .fla, and a .swf, is at the bottom to see what it turns out like ------------ i. If you've already downloaded, or made, your own preloader. Place that into frame 1, if you haven't im sure you can find a place to download one either from Kirupa or searching on google! ii. Now, make 5 frames. Add a blank keyframe into frame 2 of all of them and name them like so:
iii. On your background layer, make it a graphic (something to do with racing), or you can press CTRL + F3 to bring up the properties tab, and on background select a green colour so its like grass. iv. Select your line tool (you can do this by pressing N) and make the width of the line 10 and make the colour back. v. Now on your layer track draw out the outline of your track. If you want corners just leave as straight lines just like the picture below:
vi. When you scroll over your straight lines that will be your corners, you will notice a curved shape just below your arrow. When this appears, click and drag your line and you'll notice that the straight line turns into a curved shape - adjust this to your liking. Now you should have something like this:
vii. Select the whole of the track layer on frame 2 where your black lines should be, and turn this into an movie clip by pressing F8. Call it 'track1'. viii. Now in the 'track1' movie clip, copy all of the black lines, and 'paste in' it into the white layer, on frame 2, the track and white layer should be exactly the same - if it looks like there is 2 black lines, align one of them with the other one, and none of them EXCEPT for that the track layer has a MC on it, and the white layer has a normal drawing. ix. If you look at the track layer, you should notice 2 small circles, in between the frame name and a square. Click the one of the left (this hides the track layer). x. Select a white colour and fill in your track on the layer named white. You may select a light grey and add some effects like skidmarks. It should end up like this:
xi. You may delete all of the black lines on the layer named white. And click on the black circle on the properties of the layer named track. xii. Now we've forgotten something! On the track layer, click on the MC (movie clip) and go into the Properties tab, and on the instance name, type in land. This is so Flash MX can tell which is the boundary by the MC's instance name.
xiii. Now on frame 45, press F5 on all layer. And on the player layer, press F6 on every 15 frames. You may name the frame on CPU 'countdown' by click on the frame and going into the frames propeties and typing in 'countdown' where it says framename. This is purely for refrence. Your timeline should look like this.
xiv. Also on the layer CPU, you can draw 2 cars, one blue and one red, also draw a starting line. This is what I came up with (make sure all of the frames are like yours as on mine):
xv. Now select all of the blue car, and press F8 and make it a MC. Name it 'player' and select the red car, press F8 and make it a MC, name it 'cpu'. Put thier instances names as 'player' for player, and 'cpu' for cpu. xvi. Copy the blue car which is on the CPU layer, and ''paste in paste'' it into the layer called player on frame 46. You should leave the red car on the CPU layer, just make sure its in frame 46 along with the starting line. xvii. Now, on the blue car, add this script to it:
xiix. Now, there should be 3 blank keyframes on the player layer, between frames 2 and 40 - on the first keyframe add a '3', on the 2nd add a '2' and on the 1st and a '1'. This will make our countdown.. xix. Now, animate the CPU so it looks like its gone around the track once.. it should take up roughly 100-150 frames, depends what frame rate you are using - however, make sure the player's MC is seperate to the CPU's. On the player frame, extend it so it fits when the CPU returns to the finish. xx. After this frame, add another frame. Put 'You lose' on it with text. Add this code to it:
xxi. After this frame, again, add another frame. Put 'You win' on it. Make this frame called 'youwin'. Add this code to it:
xxii. Now, go onto the layer which the 'Start/Finish' line is on - make sure this frame goes along the whole of the CPU's animation, if not, make a new layer for it and copy and paste it onto that layer. Select the 'Start/Finish' line, and press F8. Call it anything you like. xxiii. The 'Start/Finish' line MC doesnt need an instance frame, just add this code to it:
---------- I think thats about it - if I have left anything out, please download the .fla, or the .swf to see what its like. You can edit the code/s to your likings. EDIT: The .fla is for Flash MX 2004, and I have fixed the bug(s) on the .swf file iswell.. ---------- _________________ If you need to contact me, e-mail or AIM me, ill be happy to help if im online! If you're a guest reading this, register - and join the community!! Comments
Comment #1
Comment #2
Comment #3
Comment #4
Comment #5
Comment #6
Comment #7
Comment #8
Comment #9
Comment #10
Comment #11
Comment #12
Comment #13
Comment #14
Comment #15
Comment #16
Comment #17
Comment #18
Comment #19
Comment #20
Comment #21
Comment #22
Comment #23
Comment #24
Comment #25
Comment #26
Comment #27
Comment #28
Comment #29
Comment #30
Comment #31
Comment #32
Comment #33
Comment #34
Comment #35
Comment #36
Comment #37
Comment #38
Comment #39
Comment #40
Comment #41
Comment #42
Comment #43
Comment #44
Comment #45
Comment #46
Comment #47
Comment #48
Comment #49
Comment #50
Comment #51
Comment #52
Comment #53
Comment #54
Comment #55
Comment #56
Comment #57
Comment #58
Comment #59
Comment #60
Comment #61
Comment #62
Comment #63
Comment #64
Comment #65
Comment #66
Comment #67
Comment #68
Comment #69
Comment #70
Comment #71
Comment #72
Comment #73
Comment #74
Comment #75
Comment #76
Comment #77
Comment #78
Comment #79
Comment #80
Comment #81
Comment #82
Comment #83
Comment #84
Comment #85
Comment #86
Comment #87
Comment #88
Comment #89
Comment #90
Comment #91
Comment #92
Comment #93
Comment #94
Comment #95
Comment #96
Comment #97
Comment #98
Comment #99
Comment #100
Comment #101
Comment #102
Comment #103
Comment #104
Comment #105
Comment #106
Comment #107
Comment #108
Comment #109
Comment #110
Post Your Comment
|
|
Welcome Guest! Please login to view your Member Area.
|