× Main Menu

C# Tutorial – Create a Breakout game in Visual Studio

In this tutorial we will learn how to create/develop a fully working breakout game using c# and visual studio.  You will learn how to create multiple picture boxes and use them inside of a loop using c# programming language.  This tutorial is aimed for the beginners who are learning how to program and what better way to learn than to clone an all time classic. In this tutorial we are not using any other libraries such as XNA, MonoGame, DirectX or any other. We are simply going use a windows form application and C# programming to completely create a game from scratch.

Lesson Objectives –

1) Create a simple break out game using button, picture boxes and timer

2) Create a control loop to loop through system components and identify picture boxes

3) Create picture boxes with different tags and identify them using c#

4) Keeping score within the game

5) Execute win or lose scenario for the player

6) Animate paddle and ball to give rewarding game play for the user


Full Video Tutorial


Written Tutorial for the break out game –


13 responses to “C# Tutorial – Create a Breakout game in Visual Studio”

  1. Danial says:

    i have followed the exact codes but it is still not working. please help

  2. Anhar Ali says:

    Where is the error?

  3. Anhar Ali says:

    What errors are showing? If you check them and post it here it would be helpful to pin it down.

  4. Jean Melkovsky says:

    A question: why did we make the player a button instead of a picture box?

  5. Anhar Ali says:

    There was no specific reason except I wanted to see if a button can be used to animate and interact with other objects.

  6. Syaadahr says:

    The ball and player didn’t move?? Pls help

  7. Nelson says:

    My error is the ‘private’ it says “The modifier ‘private’ is not valid for this item”.

  8. Anhar Ali says:

    Which line is this private error showing on?

  9. Nelson says:

    124, where there is private void gameOver()

  10. Anhar Ali says:

    Check the curly brackets. It might be because the function before this function is not closed. This function only stops the timer from within. Page 13 of the tutorial will show the code you need double check the codes from there.

  11. Nelson says:

    Alright, thank you i’ll try that.

  12. Nelson says:

    I can now open the game but the picture boxes are not getting hit by the ball, the ball goes through them :/

  13. saalam says:

    How i implement restart code hen game is over

Comment on this tutorial and let us know how you got on -

%d bloggers like this: