× Main Menu

C# Tutorial – Create a simple PAC MAN game in Visual Studio

In this tutorial we will learn how to create a simple pac man game in visual studio using the c# programming. There lots of PAC MAN clones around the web, we wanted to create something very simple and which does not rely on other game development libraries such as XNA, MONOGAME or DIRECTX. In this tutorial you will learn how to create a basic PAC MAN game only using the Visual Studio Components such as picture boxes,  labels and timers.

Learning Objectives –

  1. Using Animated GIFs in Picture Boxes
  2. Using collision detection for AI and for Player object
  3. Using Key DOWN and UP events to control movement
  4. Using TIMER object to animate and keep track of objects on the screen
  5. Using Collision detection to collect points and to remove that object from the scene
  6. Using a LOOP and object tag property to identify and interact with them

 

 

Download the pacman game images here

C_Sharp_PAC_MAN_Game_In_Visual_Studio




6 responses to “C# Tutorial – Create a simple PAC MAN game in Visual Studio”

  1. mc zenun says:

    I have already adopted the codes, but suddenly, pacman did not move and I don’t know why . Can you please help me ?

  2. Anhar Ali says:

    Hiya, check if the timer is enabled also check if you have linked the key down and key up events to the form.

  3. Perke says:

    Hi , i have a problem ,whenever i start the project it just says it’s GAME OVER , it doesn’t move anything , Can you please help me?

  4. Narius says:

    In case the pacman does not move, you have to start the time. For example you cand put this timer1.Start(); aftert private void keyisdown(object sender, KeyEventArgs e)
    {

  5. rutger says:

    So i’ve learned console.readkey. Ive added a while loop after timer stop. However I’m wondering if you would be able to show how a restart button is added in to this.

  6. Typo in file name down should be Down but img is labels wrong

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

%d bloggers like this: