Build a Classic Pong Game From Scratch
videos

Build a Classic Pong Game From Scratch

Tutorial Details
  • Experience Level: Beginner
  • Platform Used: Construct 2
  • Estimated Completion Time: 90 minutes

In this screencast tutorial, I’ll show you how to use Construct 2 to make a basic Pong game that can be played either against another person or against a simple computer AI. No previous programming or game development experience is required — all you need is a copy of Construct 2 (which has a free edition).


Introduction

The game we’ll build here is a pretty basic version of Pong that allows you to either play versus a human player on the same computer or against a very basic AI. You can play the finished demo here.

You probably know how Pong works, but just in case:

  • The two paddles are controlled either by the CPU, the arrow keys, or the S and X keys.
  • There is a constantly moving ball that rebounds on walls on top and bottom of the game field.
  • Each time the ball goes beyond a player’s paddle, their opponent scores a point.
  • The first player to 10 is considered the winner.

Also, pressing P pauses the game.


What to Download

For this tutorial, you’ll need a copy of Construct 2 (C2). The free edition is more than enough for the game we will make here, and is not a limited in time which makes it a perfect choice for beginners.

There are two versions of C2 to consider: Stable and Beta. The latest Beta version is always the most recent version released, and bring new features. However, the Beta versions might introduce new bugs, and are considered to be experimental versions. Stable versions offer bugfixes and an assurance that most of the features are bug free and should work as expected no matter what you do with them. They are not a different branch of the development, but simply milestones labelled as having fixed all the bugs reported in the past.

The development cycle for C2 is quite quick, with new Beta releases roughly once per week and new Stable version releases about every 6 weeks. One thing you should be aware of is that projects saved with an older version (no matter if it is Beta or Stable) can be opened in new versions. The opposite is not true though (you can’t open a project saved with r99 in r95).

As I show the use of the Image Editor Tools that were implemented after the latest Stable version (r95) I’d advise you to download this version (r99). If at the time you are reading this tutorial a newer Stable version is available, then download that instead. Every aspect of this tutorial should still apply and you should encounter fewer bugs when working on your own projects.

If you would like to download the final game source, you can get it in CAPX format here, or ZIP format here.


Watch the Screencast

Watch in full screen at 720p (use the Cog icon) for best quality.

What Next?

So you’ve made a basic Pong game – great! Now take it further. Here are some ideas:

  • Improve the graphics. You could go for an oldschool 8-bit look, a Geometry Wars-style neon look, or something totally different!
  • Add more paddles. What if both sides had one human player and one computer-controlled player?
  • Increase the challenge. Try making the ball speed up as the duration of the game goes on.
  • Introduce power-ups. Make paddles shrink or grow, or move faster or slower.

I recommend you check out the official Construct 2 manual and the tutorials on Scirra.com for more help.

Thanks for watching this tutorial!

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.NeedYourDisease.com Ben Hale

    Great tutorial. I’m glad to see Construct 2 having a presence on the site. Hope to see more.

  • SM

    Hi,

    C2(Construct 2) is a great tool, I used to use it. But I realised me using it was only me being lazy. I have and always will be a programmer, and although C2a event based system is still programming( even based programming ), I was not proud to tell people I made a game with C2 in comparison to telling someone I coded a game using a game engine such as Unity3D or UDK.

    This is just my opinion, Please do not see this as an insult.

    Thanks.

    • http://gamedev.tutsplus.com Michael James Williams

      I can see your point, but I don’t think you should rule tools like this out based on a sense of pride. I’ll quote Derek Yu:

      I made the original version of Spelunky in Game Maker, and it’s that “finished” game that eventually gave me the opportunity to work on an Xbox 360 version. So don’t ever feel that game-making software or other simplified tools are somehow illegitimate. The important thing is the game.

    • http://www.kyatric.com Kyatric

      I understand your point too.
      Ultimately, I think it’s more about the kind of tool/way you’re the most comfortable with.
      We have members in the scirra community who, on their introduction post, precise that they know how to code but wonder why bother in regards to the help C2 is for them.
      I personally first started with “regular coding” as well, but my first true released games were made thanks to C2. Also, despite the fact that I learned some JavaScript to do some plugins for C2, I wouldn’t see myself coding a full game from start to finish with it.
      It’s also nice because, as you said, it is still programming, so not a toy or as limiting as game making tools might have been at some point in the past.

      C2 tends to try to lower the barrier entry to game making, which is quite nice for beginners who never programmed before. But it is also a nice tool for more advanced users who feel less comfortable or lost with the “lower level” stuff like setting up a rendering context via code, etc…

      Anyway, I truly believe that what matters in the end is what (tool or code) you’re the most comfortable and productive with.

  • ebrar

    i’m wondering why your image editor has brushes, une gomme etc.

    mine only has two buttons there, “set origin and image points” and “set collison polygon”

    thanks in advance.

    • http://www.kyatric.com Kyatric

      You are probably using the latest stable release (r95).
      The drawing tools were added in the beta after this release (as mentioned in the paragraph “What to download”).

      To get this drawing tools too, download the newest beta release (R101 that you can download : http://www.scirra.com/construct2/releases/r101).

      Sorry for the late answer.

      • ebrar

        sorry for not reading that part. thanks again.

  • http://www.lettier.com/ LETTiER

    Funny, I just made a clone last night and now I see this. Mine runs in browser. http://www.lettier.com/poing/

    • cubtasm

      wow, nice job!

  • Faraz Mukhtar

    hello i cant access youtube in my country is their any way to view this tutorial video?