ForumsProgramming ForumTUTORIAL: Your First Game ( Learn The Basics )

96 55014
Dannydaninja
offline
Dannydaninja
948 posts
Nomad

This is a little Tutorial i made for any people who just got there hands on Flash and want to make a game. The Tutorial is divided into five parts. This will teach you the basics for Adobe Flash CS4

PART ONE

1. Go to top left corner of the screen and click on File

2. Lots of options will pour down, at the very top is " New... "

3. Now you can make a new document. Select "Flash File (ActionScript 2.0"


PART TWO

4. Now go at the top left corner of the screen and you'll see new, go a bit left and you'll find " Modify " click on " Modify "

5. At the top of those options is " Document... " click on that.

6.see the dimensions there at the top? now you can adjust the width and height of the document!! Put in " 700 px " for width and " 500 px " for height then press ok

7. Ta-da! you have now learnt how to make the size of your game.

PART THREE

8. Now on your right side ( maybe not but probably ) you'll see your selection of drawing tools. So draw something ( make sure it doesn't take up the entire screen!! ). I Drew a Red Square :P

http://i939.photobucket.com/albums/ad238/DannyDaNinja/lalaal.jpg?t=1270822048

9. Get your Section Tool ( black cursor in drawing tools )
( PRESS V FOR SHORTCUT! ) and select your entire drawing.

10. Go to Modify ( see step 4 if you get lost! ) and select " Convert to symbol ".

11. Name the Symbol "Drawing" And press OK.

PART FOUR

12. Now things get hard, Coding the game. Learning code is hard so i highly suggest you just copy and paste the code i show.

13. Select your drawing and you'll see it's " Properties ".

14. You'll see some changable text called " <Instance Name> " change that text to " Drawing "

15. Now select your drawing and press F9 to open it's actions, this is where the code is inputed

16. Enter paste the following code:

*************************************
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x--;
}
if (Key.isDown(Key.RIGHT)) {
_x++;
}
if (Key.isDown(Key.UP)) {
_y--;
}
if (Key.isDown(Key.DOWN)) {
_y++;
}
}
*************************************


17. Great! Now press Ctrl + Enter
( like you should press Crtrl Alt Delete )

18. Now you can move your drawing around using the arrow keys!


PART FIVE ( OPTIONAL )

19. This is just an optional part for anyone who wants to learn a bit more helpful code....

20. Your Drawing is going too slow isn't it? Select your drawing, press F9 and enter in this code:

******************************
onClipEvent (load) {
power = 3;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= power;
}
if (Key.isDown(Key.RIGHT)) {
_x += power;
}
if (Key.isDown(Key.UP)) {
_y -= power;
}
if (Key.isDown(Key.DOWN)) {
_y += power;
}
}
******************************

21. Now press Ctrl + Enter and you'll see that your drawing is moving faster!! But how? At the top of the code i just gave you, you'll see i added a variable to input the speed of which the instance moves.

22. Now Change the power to 5, by replacing the 3 in the code i just gave you 2 steps ago.

23. Congratz you have now learnt how to mod the speed of your drawing. Try '20' for extreme speed



____________________________________________________________

Congratulations! You have passed this tutorial if you managed to complete all the steps! This was a tutorial made by an newbie flash game developer so dont think your a sucky at flash if you get confused or lost, it's my fault not yours!!

By finishing this tutorial you have learnt the raw basics which include:

* Making A New File
* Changing The Game Size Of Your Game
* Drawing Objects
* Converting Drawings into Symbols
* How To Name Objects
* How To Make Basic Movement Code
* How To Change The Speed In The Basic Movement Code ( if you did part 5 )

I hope this could help even 1 person who needed it. NOW GIVE ME FEEDBACK!!! :P


____________________________________________________________

  • 96 Replies
Dannydaninja
offline
Dannydaninja
948 posts
Nomad

You can now also find this tutorial at my website at:

http://ddninjagamez.webs.com/tutorials.htm

Dannydaninja
offline
Dannydaninja
948 posts
Nomad

Hmmmm thats funny link didn't work, one last time!

[url=http://ddninjagamez.webs.com/tutorials.htm]

Dannydaninja
offline
Dannydaninja
948 posts
Nomad

Eh, never mind i guess you have the Tutorial right here and right now.

But if you do want to check out my website go to my AG profile and it'll be in my About.

BeastMode10
offline
BeastMode10
374 posts
Nomad

Learning code is hard so i highly suggest you just copy and paste the code i show.


That would make learning code even harder. Tut readers will only learn from the code if they manually type it out.

You might want to explain every step, also.

The tut smells like AS2. I'd suggest that you convert to AS3, because newbie flash developers definitely don't need to learn an archaic language.
2014631
offline
2014631
1,855 posts
Nomad

jeez this is impossible! I'm never making a game :P

manny6574
offline
manny6574
922 posts
Nomad

Well, it's still used and it's actually easier to learn than AS3


Umm.. I somehow find as3 waaaay more easy to understand (and organized)

but only if your making a proper game(as in what you have on AG.com)
Darkroot
offline
Darkroot
2,763 posts
Peasant

The tut smells like AS2. I'd suggest that you convert to AS3, because newbie flash developers definitely don't need to learn an archaic language.


I agree if you don't know as2 then there is no point learning the old one as3 itself is pretty old and will probably be replaced in like flash cs6 or cs7. So your doing yourself a favour if you learn as3.

Well, it's still used and it's actually easier to learn than AS3.


Kurt you should know better now, as3 and as2 are extremely similar so the difficulty is the same. What you might of needed 3 lines of code to do in as2 you might need like 5 or 6 in as3 but it's for your benefit since the structure of as3 is much better made.
Dannydaninja talk about quadruple post.
Dannydaninja
offline
Dannydaninja
948 posts
Nomad

Thanks for all the feedback guys!!

Yeah i guess i should of expsplained the code.

Komputer Kurt, thanks for the fixed link and cutting down the code

jeez this is impossible! I'm never making a game :P


Really?? This is an easy tutorial. Sorry if i made it sound hard!! It should only take a noob about 25 minutes to complete.

Umm.. I somehow find as3 waaaay more easy to understand (and organized)


Sure it's more organized but i find AS2 Easier to "LEARN"

Dannydaninja talk about quadruple post.


Lol yeah, sorry about that!
Glazastik
offline
Glazastik
10 posts
Nomad

How do you find the F9 thing on a mac

Glazastik
offline
Glazastik
10 posts
Nomad

I found it, but I can't give it actions??

rjbman
offline
rjbman
215 posts
Nomad

Glazastik, why don't you go on the toolbar>>window>>Actions?

That should pull it up.

Glazastik
offline
Glazastik
10 posts
Nomad

I found it as I said, but it won't allow me to put in code for the symbol, I'm on a mac and it is in Swedish. Sucks to fail on the easiest part. I made into a symbol, does the type matter?

rjbman
offline
rjbman
215 posts
Nomad

I found it as I said, but it won't allow me to put in code for the symbol, I'm on a mac and it is in Swedish. Sucks to fail on the easiest part. I made into a symbol, does the type matter?


No, what you need to do is go to your main timeline, add a new layer named actions, and then just click on the layer frame. You don't actually code on the object; well usually you don't. And you still program with a separate layer typically, and you don't select an object.

Summing it up, you can't code while selecting something.
rjbman
offline
rjbman
215 posts
Nomad

I'm pretty sure he's working on AS2 and in that case the code is done on the objects. If he is doing AS3 then it's done on a frame but not using the code shown in this tutorial.


Oh right I'm sorry... forgot. My bad. Ignore me.
Glazastik
offline
Glazastik
10 posts
Nomad

I get some mouse-issue now

Showing 1-15 of 96