Simple Flash Game Tutorial #1

Post all your tuts or request for tuts here.
Post Reply
User avatar
rockinliam
Posts: 466
Joined: Sun Jun 07, 2009 11:26 am

Simple Flash Game Tutorial #1

Post 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;
}
Last edited by rockinliam on Thu Jun 10, 2010 12:13 pm, edited 1 time in total.
Skillset: C/C++, OpenGL, C#, Lua, PHP, MySql, Web Dev etc.
Website: https://liam-griffiths.co.uk/
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Simple Flash Game Tutorial #1

Post by Baseball435 »

What is all of the second videos code?
User avatar
rockinliam
Posts: 466
Joined: Sun Jun 07, 2009 11:26 am

Re: Simple Flash Game Tutorial #1

Post by rockinliam »

All the code i write is at the bottom of the post.
Skillset: C/C++, OpenGL, C#, Lua, PHP, MySql, Web Dev etc.
Website: https://liam-griffiths.co.uk/
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Simple Flash Game Tutorial #1

Post by Baseball435 »

Oh ok. Well for me it only says the first bit of code
Post Reply

Return to “Tutorials”