× Main Menu

C# Tutorial – Create a Pong arcade game in Visual Studio

In this tutorial we will learn how to create a fully functional Pong game in visual studio using c# programming language. We will use Windows Form Application to make this game. Player has up and down key board controls and we have an opponent controlled by the CPU and we will program it in the code. We will be using Visual Studio 2010 version however this will work with any other new version of Visual Studio.

Lesson outcomes –

  1. Create a fully working pong arcade game
  2. Collision detection between player and CPU
  3. Using picture boxes and its properties in C#
  4. Using timer component to animate the ball, player and opponent
  5. Create a boundary limit for the player and CPU
  6. Keep score for both player and CPU
  7. Increase the ball speed when either of the players score in the game

Demo:

C_Sharp_create_a_pong_game_in_visual_studio3




6 responses to “C# Tutorial – Create a Pong arcade game in Visual Studio”

  1. ClashinMashing says:

    the ball sometimes stick to the player

  2. Foxtato says:

    I can’t get the ball to move, eventhough my code is the same

  3. EpsilonIT says:

    What would you add to the code to make it where if someone resizes the game?

  4. ozgr says:

    How can ı use horizontal player?

  5. Anhar Ali says:

    @EpsilonIT you can change the form border style in the form properties window to fixed single or fixed dialog this will prevent anyone from resizing the window.

  6. Anhar Ali says:

    @ozgr if you want to make the game horizontal then you will need to use the player.Left and opponent.Left value instead of the Top value this will take the player and opponent side to side.

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

%d bloggers like this: