Page 1 of 1

Simple Flash Game Tutorial #1

Posted: Sat Jun 05, 2010 9:03 pm
by rockinliam
Hello and welcome to my tutorial on building a simple flash game.
In this video we write the movement script. Some code got a bit cut of sorry so its all at the bottom.

[youtube]http://www.youtube.com/watch?v=0Bh1L6Owneo[/youtube]
[youtube]http://www.youtube.com/watch?v=N3ynh6yC4gI[/youtube]

Here is the code:

Actions on frame 1:

Code: Select all

stop();
Actions on our player movie clip:

Code: Select all

onClipEvent (load) {
	power = 0.3;
	yspeed = 0;
	xspeed = 0;
	friction = 0.97;
	gravity = 0.05;
	thrust = 0.6;
}
onClipEvent (enterFrame) {
	if (Key.isDown(Key.LEFT)) {
		xspeed -= power;
	}
	if (Key.isDown(Key.RIGHT)) {
		xspeed += power;
	}
	if (Key.isDown(Key.UP)) {
		yspeed -= power*thrust;
	}
	if (Key.isDown(Key.DOWN)) {
		yspeed += power*thrust;
	}
	xspeed *= friction;
	yspeed += gravity;
	_y += yspeed;
	_x += xspeed;
}

Re: Simple Flash Game Tutorial #1

Posted: Wed Jun 09, 2010 7:43 pm
by Baseball435
What is all of the second videos code?

Re: Simple Flash Game Tutorial #1

Posted: Thu Jun 10, 2010 12:14 pm
by rockinliam
All the code i write is at the bottom of the post.

Re: Simple Flash Game Tutorial #1

Posted: Fri Jun 11, 2010 12:56 am
by Baseball435
Oh ok. Well for me it only says the first bit of code