Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

Create a Flash game like Metro Siberia Underground

Multipart tutorial: available parts 1, 2, 3, 4 ,5

I was quite impressed of a new game called Metro Sibera Underground… a game with a very simple concept, simple graphics but excellent level design.

Metro Siberia Underground

Metro Sibera Underground (MSU from now on) is a one button game, and that means that you can play the game only using one button. MSU uses the SPACEBAR to thrust the engines. Fullstop. Player will feel gravity when the engines aren’t working.

Apart from the excellent level design, MSU features a blurred graphic that reminds early 80′s coin-ops.

In this first part, I am creating the blurred graphics and the movement system.

Only two object involved in the project: a triangle representing the ship, and a square representing the smoke.

Line 1: Importing the library needed for the glow filter

Lines 2-3: Defining ship and smoke glow filters. This will give the blurry effect. More information about filters at Create a flash draw game like Line Rider or others – part 1.

Line 4: Setting the gravity

Line 5: Setting the thrust

Lines 6-7: Defining ship x and y speeds. x speed never changes. Play with the variables just explained to see how they will affect gameplay. You can find more information about gravity and thrust at Flash game creation tutorial – part 1

Line 8: Defining a variable to store the interval between a smoke cloud and the next one. In my game, I want the ship to release smoke only when the engines are used

Line 9: Counting the frames passed since the release of the last smoke cloud

Line 10: Variable to check if the player is using engines or not

Line 11: Placing the ship in game

Line 12: Applying the glow filter to the ship

Line 13: Function the ship will execute at every frame

Line 14: If the player is using engines…

Line 15: Decrease y speed (because a negative number means the ship is going up)

Line 16: Decrease smoking interval (because the player is going pedal to the metal)

Line 18: Adding gravity to y speed

Line 19: Updating ship y position

Line 20: Calculating the angle of the ship using trigonometry. Some hints about trig at Create a flash draw game like Line Rider or others – part 3

Line 21: Updating ship rotation

Line 22: Increasing the variable counting the number of frames passed

Line 23: If it’s time to release the smoke..

Line 24: Placing the smoke particle on the scene

Line 25: Applying the glow filter to the smoke particle

Line 26: Function the smoke particle will execute at every frame

Line 27: Updating smoke particle x position

Line 28: Making the smoke a little more transparent

Lines 29-31: When the smoke becomes totally transparent, remove it from the stage

Line 33: A smoke particle has been just placed, so the frames passed since the last placement must be set to zero

Lines 36-39: When the player presses the mouse, turn on engines and set the smoke interval to 10 frames

Lines 40-43: When the player releases the mouse, turn off engines and set the smoke interval to 100000 frames

And that’s it! You may need to reload the page to see the game working. Press the mouse to keep the ship flying

Then download source code and start flooding the web with MSU clones :)

Multipart tutorial: available parts 1, 2, 3, 4 ,5

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 5.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 55 comments

  1. Marcos

    on January 18, 2008 at 2:49 pm

    Hi Emanuele,

    Pretty cool tutorial. Can you make a tutorial teaching us how to make the tunnel levels like Metro Siberia? Is is a big MC or is it created dynamically? It’s amazing.

    Congratulations for your work.

  2. Lachy

    on January 18, 2008 at 3:11 pm

    Hey,

    Yeah im interested in creating things dynamically, ive had 2 game ideas i just dont know how to make yet could be so good! You should do personal tutoring! :D

  3. Emanuele Feronato

    on January 18, 2008 at 3:52 pm

    I don’t think it’s a big MC… it’s really huge.
    Being linear, it could be created dynamically, removing clips when they left the game to the left side.

  4. Beedigital

    on January 18, 2008 at 3:57 pm

    I believe Emanuele will do a second part with the tunnel. This can be pretty usefull for many games, not just the ship style.

    I´m having some ideas too. Let’s see if I can put them to practise. Need some time….

  5. Hawdon

    on January 18, 2008 at 4:09 pm

    Hi Emanuel,

    I am trying to make the player “die” by going to a “you loose” frame if they hit the wall and I had this code on the wall:

    onClipEvent (enterFrame) {
    if (_root.ship.hitTest(true)) {
    gotoAndStop(“youloose”)
    }
    }

    But when I tested it it didnt work… I dont know why.. Could u help me plz?

    Sincearly, me :P

  6. Lachy

    on January 18, 2008 at 5:08 pm

    How would we create all the ‘blockers’ dynamically?

  7. Ed

    on January 18, 2008 at 6:51 pm

    Is it just me, or do you work for MochiAds? You’re always picking games with a MochiAds intro, you get to use their highscore system first, you announce their competitions and new features, and all your games have MochiAds in them.

    I know that game isn’t created with API, but it would be a good tutorial to make random levels with API in part 2.

  8. Emanuele Feronato

    on January 18, 2008 at 7:12 pm

    I don’t work for MochiAds, I just made a game to betatest their leaderboard system.

    Anyay, you forgot to mention I won the referral bonus in their last competition…

    This is becoming really suspicious, isn’t it?

  9. shiv

    on January 18, 2008 at 7:40 pm

    “COOL”
    Its great. If we can only add a gun to it and a trail effect at _alpha 20 or so. Or any of the enemies, with a brutal AI?

  10. Ed

    on January 18, 2008 at 8:02 pm

    Yeah it is. Make an entry on the best ways to get a game sponsored and the best sponsors there are. In fact it would be great to see all the ways to make money in flash games, other than MochiAds (which really doesn’t pay well for small games). If you need some research material have a look at these two sources:

    Sponsor Review Thread:
    http://www.newgrounds.com/bbs/topic/722868/1

    flashgamesponsorship.com

  11. emanuel

    on January 18, 2008 at 11:14 pm

    hi how u make the trunel random sorry for the stupid question

  12. emanuel

    on January 18, 2008 at 11:15 pm

    like jetman(facebook)(read my other post)

  13. robby

    on January 19, 2008 at 12:35 am

    hi emanuele, kinda off topic here, but do you think one of these day you’ll add some kind of forum to your website, with different boards, maybe a section like collab, art, music,…. it would be cool having a forum on this site so we can exchange ideas, maybe people can work together and make games off your tutorial. Anyways, love the new tutorial, keep up the good work :) and glad they removed you from google’s “black list” :D

  14. Kesh

    on January 19, 2008 at 1:16 am

    onClipEvent (enterFrame) {
    if (_root.ship.hitTest(true)) {
    gotoAndStop(”youloose”)
    }
    }

    should be

    onClipEvent (enterFrame) {
    if (_root.ship.hitTest(WALL)) {
    gotoAndStop(”youloose”); // make sure there is //a semi colon
    }
    }

  15. Kesh

    on January 19, 2008 at 1:17 am

    oops that was for Hawdon

  16. Emanuele Feronato

    on January 19, 2008 at 2:08 am

    robby: a forum is what I have planned to do during this weekend.

  17. Shiv

    on January 19, 2008 at 8:00 am

    Great,
    Add a forum and also some kind of chatroom.
    In which ppl can instantly message you and ask their questions.

  18. Hawdon

    on January 19, 2008 at 11:55 am

    thx :D

  19. grimlock

    on January 19, 2008 at 4:49 pm

    Are we allowed to use this code or is it copyrighted? I make my own graphics and combine it with other code
    can we use it for our own commercial games
    Im confused on the whole copyright code

  20. Emanuele Feronato

    on January 19, 2008 at 6:19 pm

    You can freely use any code you find on this site.
    Should you make a lot of money, just remember I am always thirsty :)

  21. Randomguy

    on January 20, 2008 at 8:52 am

    could you show how to make the levels dynamically like in fly the copter? thanks

  22. Shiv

    on January 20, 2008 at 2:04 pm

    sIMPLY GRAT eManuele,

    Your experiments window is imply great.
    But still it is really hard to understand that how guessnext is doing better than tileball.

    GuessNext was just a play of luck. While tileball requires skill. It seems that it will even take over your circle chain.

  23. Jack

    on January 20, 2008 at 7:23 pm

    Hi Emanuele!

    Nice tutorial…

    I have one question… I did one Maze game, but the people can simply cheat using right click… How do i do an anti-cheat, so the people can’t use right click button?

  24. Emanuele Feronato

    on January 20, 2008 at 10:10 pm

    Shiv: I think because Tileball is a bit too hard for casual players and does not have highscores (no replay value). Also tileball makes almost 10,000 plays/day but with a very low CPM

    Jack: Just don’t make a level on every frame, but keep all your code in a single frame.

  25. Eblup

    on January 21, 2008 at 6:13 am

    Long time no see.
    Fianaly!!! a good interactive tutorial!
    the past tuts have been all about clicking to do some thing with something you cant control…
    but in the you finally get control

  26. Jack

    on January 21, 2008 at 12:22 pm

    Emanuele:

    I didn’t expressed very well… The people aren’t going to next level… They are “teleporting” the mouse to the end…

    Check my game here: http://www.newgrounds.com/portal/view/420884

    When a level starts, you can just right click and click in the exit… And the ball will teleport to exit… They aren’t going through levels…

  27. Shiv

    on January 21, 2008 at 12:25 pm

    Great Emanuele, but tileball is so magnificent that it deserved to be at the top.

    I am sure even you havent crossed all the levels.

  28. Bobb

    on January 21, 2008 at 12:28 pm

    Thanks! Your site is invaluble to me!

    Love it

  29. Wall Dodge - game made from Metro Siberia Underground tutorial : Emanuele Feronato - italian geek and PROgrammer

    on January 21, 2008 at 2:10 pm

    [...] two days after the publishing of Create a Flash game like Metro Siberia Underground, Oskar Koli tries to answer one of the most commons questions asked in the comments… how to [...]

  30. Metro.Siberia | Programming

    on January 22, 2008 at 1:28 am

    [...] Emanuele Feronato is developing a simmiliar game based on this one. If interested visit his website to stay tunned and get the source files. [...]

  31. Tommy Salomonsson

    on January 24, 2008 at 5:00 pm

    I had no idea that there were such a public interest in learning how to make a Metro Siberia game. I think you have made a good tutorial, teaching the basics in a way that is easy to understand.
    /T

  32. Emanuele Feronato

    on January 24, 2008 at 5:06 pm

    Thank you!
    From the creator of the original game is more than a compliment!

  33. About to relelase the forum : Emanuele Feronato - italian geek and PROgrammer

    on January 24, 2008 at 6:53 pm

    [...] maintenance does not allow me to upload files… I have a dynamically generated tunnel for Metro Siberia Underground but you’ll have to wait until tomorrow to see it AFAIK. Meanwhile I would like you to know [...]

  34. Goinginsane

    on January 24, 2008 at 8:52 pm

    I think its just me. But for some reason Flash is telling me that the action script is containing errors. I have recoppied it and have tried to put the code in both the ship and the frame. I have flash MX. Please help me!

  35. RJ

    on January 24, 2008 at 9:33 pm

    Since you released this tutorial a week ago, I’ve seen 3 or 4 games using it. Definetly, it has been really useful for a lot of people

  36. Create a Flash game like Metro Siberia Underground - Part 2 : Emanuele Feronato - italian geek and PROgrammer

    on January 25, 2008 at 2:19 pm

    [...] Create a Flash game like Metro Siberia Underground if you don’t know what I am talking about and look what I [...]

  37. Metro.Siberia | aboutall

    on January 26, 2008 at 11:02 am

    [...] Emanuele Feronato is developing a simmiliar game based on this one. If interested visit his website to stay tunned and get the source files. [...]

  38. aboutall.za21.info » Blog Archive » Metro.Siberia

    on January 27, 2008 at 8:38 pm

    [...] Emanuele Feronato is developing a simmiliar game based on this one. If interested visit his website to stay tunned and get the source files. [...]

  39. news4u.qa2.info » Blog Archive » Metro.Siberia

    on January 27, 2008 at 9:51 pm

    [...] Emanuele Feronato is developing a simmiliar game based on this one. If interested visit his website to stay tunned and get the source files. [...]

  40. Create a Flash game like Metro Siberia Underground - Part 3 : Emanuele Feronato - italian geek and PROgrammer

    on February 1, 2008 at 10:12 pm

    [...] suggest to read part 1 and 2 before reading this [...]

  41. Flashtoo

    on February 6, 2008 at 6:07 pm

    U should replace the hitTest(true) with
    hitTest(this)

  42. Flashtoo

    on February 6, 2008 at 6:09 pm

    goingisnane, it dusnt work because flash mx uses a other type of actionscript as flash 8.
    Get flash 8!

  43. Protect your ActionScript with Amayeta’s SWF Encrypt : Emanuele Feronato - italian geek and PROgrammer

    on February 11, 2008 at 12:41 pm

    [...] preview the movie you currently selected. As you can see, I am trying to protect my prototype of Metro Siberia Underground [...]

  44. Create a Flash game like Metro Siberia Underground - Part 5 : Emanuele Feronato - italian geek and PROgrammer

    on February 12, 2008 at 9:36 pm

    [...] do you remember Metro Siberia Underground is a one button game? And that the one an only button you can press in this game is already used to [...]

  45. moloy

    on February 13, 2008 at 2:17 pm

    All these tutorials are really great and very helpful indeed. Especially because they are complete with source files.. Thanks a lot.

  46. Create a Flash game like Metro Siberia Underground - Part 4 : Emanuele Feronato - italian geek and PROgrammer

    on February 13, 2008 at 6:55 pm

    [...] this 4th part I’ll cover the code written in 3rd part. You should read parts 1 and 2 too, because I will comment only the new [...]

  47. Gravelcore

    on February 20, 2008 at 1:19 am

    can you please explain how you made the levels or make a tutorial of how you did. please……?

  48. roboman

    on April 4, 2008 at 10:06 am

    i’ve changed the code a little to made the smoke grow a bit smaller while turing transparent:

    import flash.filters.GlowFilter;
    var ship_filter:GlowFilter = new GlowFilter(0x00ff00, 0.8, 4, 4, 2, 3, false, false);
    var smoke_filter:GlowFilter = new GlowFilter(0xff0000, 0.8, 4, 4, 2, 3, false, false);
    gravity = 0.1;
    thrust = 0.25;
    yspeed = 0;
    xspeed = 5;
    smoke_interval = 10000;
    frames_passed = 0;
    engines = false;
    _root.attachMovie(“ship”, “ship”, _root.getNextHighestDepth(), {_x:150, _y:200});
    ship.filters = new Array(ship_filter);
    ship.onEnterFrame = function() {
    if (engines) {
    yspeed -= thrust;
    smoke_interval -= 0.25;
    }
    yspeed += gravity;
    this._y += yspeed;
    angle = Math.atan2(yspeed, xspeed);
    this._rotation = angle*180/Math.PI;
    frames_passed++;
    if (frames_passed>=smoke_interval) {
    sm = _root.attachMovie(“smoke”, “smoke”+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x-2, _y:this._y});
    sm.filters = new Array(smoke_filter);
    sm.onEnterFrame = function() {
    this._x -= xspeed;
    this._alpha -= 2;
    this._height-= 0.25;
    this._width-= 0.25;
    if (this._alpha<=0) {
    this.removeMovieClip();
    }
    };
    frames_passed = 0;
    }
    };
    _root.onMouseDown = function() {
    engines = true;
    smoke_interval = 10;
    };
    _root.onMouseUp = function() {
    engines = false;
    smoke_interval = 100000;
    };

  49. roboman

    on April 5, 2008 at 5:28 am

    whats the problem with my hittest?
    flsh says the script may make the computer irresponsive:

    game = true;
    {
    if (_root.ship, hitTest(_root.WALL)) {
    game = false;
    gotoAndStop(“gameover”,1);
    } else {
    game = true;
    gotoAndPlay(“game”,1);
    }
    }
    stop();

  50. bob

    on June 18, 2008 at 9:39 am

    do these tutes work on flash cs3?

  51. bob

    on June 18, 2008 at 9:42 am

    would this .fla open up with cs3 at least?

  52. RRODE: the second one-week game : Emanuele Feronato - italian geek and PROgrammer

    on July 24, 2008 at 10:43 am

    [...] an one button game (a game that you can play just pressing a button, like Metro Siberia Underground) based on the prototype of a Flash game like [...]

  53. Morlog

    on January 21, 2009 at 7:00 pm

    hi im trying to make my thing explode when it hits the wall. but how do i do it?

  54. The perfect size for a Flash game : Emanuele Feronato

    on April 20, 2009 at 1:21 pm

    [...] set the stage size according to the gameplay (a Tetris clone should have a portrait size, while a Metro Siberia Underground clone should have a landscape size), it’s interesting to have a brief overview about other [...]

  55. Tutorials » salomonsson.se -

    on March 1, 2010 at 12:37 am

    [...] It’s not exactly how I did it, but if you are new to flash then his tutorial is a great start:http://www.emanueleferonato.com/2008/01/18/create-a-flash-game-like-metro-siberia-underground/ Published: 2010.02.28 Leave a Comment Cancel [...]