ForumsProgramming ForumHOW DO YOU MAKE A FLASH GAME???

21 8204
crazyclive
offline
crazyclive
44 posts
Nomad

HOW DO YOU MAKE A FLASH GAME?

  • 21 Replies
Talo
offline
Talo
945 posts
Nomad

with flash, duh.

markrjg
offline
markrjg
11 posts
Nomad

with flash, duh.

i think he has flash and he wants to know the code.

HOW DO YOU MAKE A FLASH GAME?

thats simple:
firstly if you dont have flash you can download a free trial on the adobe website.
secondly when you get flash, draw a square or what ever you want, and make it a movie clip by right clicking on your character and click convert to symbol.
then select your caracter press F9 and insert this code:

onClipEvent (load) {
movespeed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
play();
_rotation = 90;
_x += movespeed;
}
if (Key.isDown(Key.LEFT)) {
play();
_rotation = 270;
_x -= movespeed;
}
if (Key.isDown(Key.UP)) {
play();
_rotation = 0;
_y -= movespeed;
}
if (Key.isDown(Key.DOWN)) {
play();
_rotation = 180;
_y += movespeed;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP)) {
_rotation = 45;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP)) {
_rotation = 315;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)) {
_rotation = 135;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN)) {
_rotation = 225;
}
}

this may look tricky, it not. its when your making your own code thats the annoying part..
next you may want to make walls so click your character and on the properties of it it says >instance name< call him 'Man' with the capital letter, then create your wall with lines then make it a movie clip press F9 and insert this code it you want it to repel down:

onClipEvent (enterFrame){
if(_root.Man.hitTest(this)){
_root.Man._y+=7;
}
}

up:
onClipEvent (enterFrame){
if(_root.Man.hitTest(this)){
_root.Man._y-=7;
}
}

left:
onClipEvent (enterFrame){
if(_root.Man.hitTest(this)){
_root.Man._x-=7;
}
}

right:
onClipEvent (enterFrame){
if(_root.Man.hitTest(this)){
_root.Man._x+=7;
}
}

the character will bounce off it abut its alright.
next you will want to get to a new level well create a portal like thing and make it a movie clip and insert this code:
onClipEvent (enterFrame){
if(_root.Man.hitTest(this)){
_root.gotoAndPlay(insert frame number here);
}
}

the 'insert frame number here' replace it with the frame number you want to go to when it dies or goes to the next level.
you may want to make a blank key frame at the end of the level or it will be in the same position when level 2 starts
next ill show you how to make a custom cursor, all you do is create your cursor then make it a movie clip and enter this code:
onClipEvent (load) {
Mouse.hide();
startDrag(this, true, 0, 0, 550, 400);
}

the 550 and 400 you replace with the width and hieght of the frame.
also i forgot to add in every level click on the frame and add this code:
stop();

i hope this has helped.
markrjg
PsychoIncarnate
offline
PsychoIncarnate
1,037 posts
Nomad

I want to know how to save data so it transfers to other levels and etc.

markrjg
offline
markrjg
11 posts
Nomad

I want to know how to save data so it transfers to other levels and etc.

hmm... ive not learnt that yet
Captain_J_Sheridan
offline
Captain_J_Sheridan
313 posts
Nomad

Use a global variable instead of a normal one

Instead of

score = 100;


use

_global.score = 100;
dank
offline
dank
983 posts
Peasant

Learn to type normally.

Flash doesn't understand all caps.

KGuare
offline
KGuare
29 posts
Nomad

Flash doesn't understand all caps.


Unless of course you're dealing with constants. :]

But you obviously make a good point,
learning any programming language is difficult
when you don't have enough patience to type
your own language the correct way.

But to answer your question crazyclive,
you make flash using Adobe Flash, and
programming using either ActionScript 2.0 or 3.0.
The newest version of Flash is CS4, and they
have a free 30 day trial on the Adobe Website.

There's a lot of fuss about weather it's better
to learn AS2 or AS3, but overall AS3 is a LOT better.
It's a lot more strict in syntax, though,
so you'll have to learn to type properly.

May i also add...practice makes perfect.
Nobodies good at flash in a day, or a week, or even a month.
Hell, i still don't think i'm that good at flash.
So be patient, and just stick to it.
The cost of CS4 may be quite a lot, but,
buy the student version to learn, and
it'll eventually pay for itself.

Good luck. :3
runescape95
offline
runescape95
46 posts
Nomad

im not asking it might work

Samurai7x
offline
Samurai7x
64 posts
Nomad

how do i use "w" "a" "s" "d" for the controlls

Drace
offline
Drace
3,880 posts
Nomad

You gotta do stuff and do some other stuff and use some magic and stay in school

Samurai7x
offline
Samurai7x
64 posts
Nomad

for the controlls of the game instead of up down left right

TheSid
offline
TheSid
332 posts
Nomad

I KNOW
BUT I'M NOT TELLING YA

Aaroniscool
offline
Aaroniscool
254 posts
Nomad

Idk if this works but couldn't you use the ASCII system to do stuff with wasd?

Riou1231
offline
Riou1231
4,825 posts
Peasant

learn to make flash then get flash simple but when you see how hard it is you better leave it to the professionals

Samurai7x
offline
Samurai7x
64 posts
Nomad

when i switch it it doesnt work so shut up

Showing 1-15 of 21