How to make PAC MAN game in Windows Form and C# with Visual Studio

preview_player
Показать описание

In this tutorial we will be making a simple pac man game in visual studio with Windows form and C#. In this game we will control pac man in 4 different directions. Up, down, left and right. In the images you will find a GIF to represent all 4 directions. You have 4 walls and 3 moving ghosts in the game. The main objective of this game is to, collect all of the coins and not touch the ghosts or walls. IF you do then the game is over.

3 Ghosts in the game will have their own movements and collision with the walls and the player. This process will give you an idea of how to program standard AI inside of a game and you can use the same process in other projects.

We will learn how to make this together by adding of the elements manually and then writing the c# script animate and logically progress through the game.

Instead of removing the elements from the form this time around we are using a different approach. We will show you how to make a component invisible in Windows Form once you have interacted with it, and gain a score from it.

Hope you have fun with this one, and keep making stuff it really doesn't matter what it is long as you keep at it you will only get good at it.

Moo out.
Рекомендации по теме
Комментарии
Автор

I have to make this game as homework, and as a starter this helped me a lot, lot lot.
Still I needed something a bit more complicated with the ghosts, they're supposed to do a different task each, im still figuring that out!
Thank you a lot!!

starrypolaris
Автор

You really helped me a lot!! Thank you so much!! I've learned a lot of things thanks to you!! :DD Good vibes to you wherever you are!!!

HeikkiCoga
Автор

what a video thankyou so very much, u saved my coursework

ronixxfnbr
Автор

Thanks dude, up helped me so much on learning about "How to use foreach"... Thank you so much ~~~

Petra_Christalbert
Автор

Thank you for the video, good and simple manual.

AlexAnder-fkyg
Автор

Thank you! the best game tutorial in my life)

ІТ-ДовганьВалерія
Автор

Thanks. Done it. Next stop jet shooter.

arvsnacs
Автор

Thankyou just made this for small project :) Best tutorial!!!!🫶🏻🫶🏻❤️

jsdnbtm
Автор

thank youu
Your training was
I wish you success^^

rosearysh
Автор

I’m having problems with my program. It keeps saying there is an error when I write private void reset game. Also I cannot properly move Pac-Man around. I do not know the problems I’m having as I have followed all of your steps. Any help?

AdewumiT
Автор

How can I make this a 2 player game by making one of the ghosts move using the wasd keys?

SP-hrfc
Автор

thank you sir you teach me how to create a game using c#

WHITEHAPPY
Автор

How do I make PacMan stop when it touches the wall instead of the game ending?

robertmanolache
Автор

I have a question i desigend the form loike you did but when i debuged the game pink and yellow ghost werent in thier place and i didnt finish the code at that time

mahyarrad-voot
Автор

'KeyPressEventArgs' does not contain a definition for 'KeyCode' and no accessible extension method 'KeyCode'. It seemss to be fine in keydown but not working in the keyisup function?

connorboyle
Автор

Game over label is not come when the game is over and in the code u gave there is no reset and game over function in the written code

vidhirughani
Автор

I can't get my ghosts to slow down :/ they bump against the walls but really really fast, they are set to 1 :( and they are still not slowing down... any suggestions how I can fix this?

megclements-paterson
Автор

please can you make a video of how can make the coins make a sound we pacman collect it

akura_
Автор

If you can help, the yellow ghost is moving from picturebox 4 to the right, instead of picturebox 3, how can I fix it?


Thanks ☺

unajokic
Автор

I have a question... Why do you use pacman.Left
( if (goleft == true)
{
pacman.Left -= playerSpeed;
pacman.Image = Properties.Resources.left;
}
)
and pacman.Top
( if (godown == true)
{
pacman.Top += playerSpeed;
pacman.Image = Properties.Resources.down;
}
)
for pacman's movement and not pacman.Right or pacman.Bottom?
I mean if he goes bottom, why don't you use pacman.Bottom ?

noonecaresbish
welcome to shbcf.ru