Download this project here github.com/mooict/Top-Down-Zombie-Shooter-Game-in-Windows-Form
@Siddh_Galactica4 жыл бұрын
Wow Brother You aren't just a professional VS user and programmer but also a really Good web developer with an own website
@sumabich7213 жыл бұрын
Damn, your website is genius. I've been working with Unity and C# but I felt like the engine makes things a bit too uncomplicated and easy. It's very convinient and powerful of course, but there's concepts I feel like I'm not learning cuz they're built into the engione. Things like coordinates, physics and how objects interact with each other, all of that is build into it and I wanted to learn how do to things with just C#. Really think through these myself to really build an understanding. Your website is a godsend for this, thank you very much good sir.
@mooict3 жыл бұрын
Thank you so much for this lovely comment. Really made my day. I'm glad you are finding the tutorials useful.
@DrYamiru2 ай бұрын
I will use this for my project, THANKS!
@shouravmandal60793 жыл бұрын
Your videos are very easy to understand even for a beginner like me. They are actually helping me learn C# programming in a more fun way. Love them man. Keep making more amazing C# gaming videos please 🙏🙏!!
@Ibbydala2 жыл бұрын
thanks you were exactly what i was looking for as a current 20 year old web developer
@guerriero1353 жыл бұрын
Man, I do not know what to say, except that I found this guide very helpful! I have been making a little Rhythm Game for Visual Studio and I was struggling thinking on how to make the note generation system, so I took inspiration from your bullet generation system. Thank you again! I feel so happy at the moment! Kindest Regards from Italy!
@mooict3 жыл бұрын
I'm happy too 😃☺️. Thank you for the lovely comment.
@kabangdah_demon2 жыл бұрын
thank you sir for this video tutorial I can finally do my final semester exam🙏🏻
@chriszurita3 жыл бұрын
What an amazing language C# is I hope to be this good soon
@sarvarbekrahmonov95592 жыл бұрын
Amazing video, you just helped me with my final project for my cs class.
@donsheranda71794 жыл бұрын
Thank you so much...i have learned lot of things...thank you ❤️❤️
@junlee33 жыл бұрын
Love This Tutorial!!1 Thank you! I subbed!
@Ibbydala2 жыл бұрын
bro you deserve more subscribers man
@mooict2 жыл бұрын
Thank you.
@fishwishpishpish91654 жыл бұрын
thanks so much for making these mate
@zecklee14023 жыл бұрын
Thank you for the tutorial, it really helped a lot!
@mejay0234 жыл бұрын
Thanks you for this video!
@peterrothas19444 жыл бұрын
this is a great video, thanks for that
@luizfabianorosaribeiro25942 жыл бұрын
Top de mais. Pena que a curtida aqui e apenas 1 vez. Obrigado por compartilhar o conhecimento.
@dijkstrasalgorithm69414 жыл бұрын
really fun coding and playing this, although the Drop ammo function seems to screw up a bit sometimes.
@shero_u2 жыл бұрын
Thank you so much
@chiipan73 жыл бұрын
Hello, very clear and well made tutorial. However, I have run into a few issues. - The bullet optimization (the one that deletes the bullets once reaching a certain range) causes the bullets to not fire at all. - This one in particular is really giving me a headache. When I want to code something regarding the pictureboxes, for example in the zombie following AI, the "x" variable is undefined for some reason. causing a lot of errors and even not letting zombies spawn.
@YnMarin Жыл бұрын
Hello friend, greetings from Colombia. I have a problem with bullets. I have the code up to there for the moment. My problem is that when I shoot = "space" the bullets do not appear as they should. And all the code is fine. Instead, white dots appear at the top where the text appears (kills, health, ammunition) this is independent of whether I shoot from the left side or from any position, apparently they look like this. I would like to know what I can do. Thank you
@kimcamila41583 жыл бұрын
thank you very much! im using it for my school project, but im having a little problem with changing the pictures. i just dont know where i should change it( anyways thanks for making a great tutorial!
@kumatoons55083 жыл бұрын
bro thay cow pic is soo ✨ i would kiss it
@amansoni62 жыл бұрын
Sa here bro had everytNice tutorialng sitting for half a year before I started to dive in
@cristi94833 жыл бұрын
Can you suggest how to make zombies not collide with each other. At some point they get stacked on each other and I can't find a way to change that.. Can you help me?
@tftechfun73892 жыл бұрын
thanks bro i make also this game
@sacal87684 жыл бұрын
Thank You
@tirolocomcleod2 жыл бұрын
I went through your code line by line and I get how you have the zombies following the player. I have a question for you, what if I wanted to add a weapon for the player like a grenade or a sticky weapon that sticks to a zombie? But have it randomly choose which zombie gets picked and the grenade gets thrown to that zombie.
@useup45503 жыл бұрын
Thank you soo much
@juliagabrielapinedo73324 жыл бұрын
Which code can I implement to do a final boss that can shoot to my player character? Btw thanks for your tutorial, it helped me a lot into developing my own game.
@mooict4 жыл бұрын
Hi I haven't experimented with boss battles yet. In Windows form it can complicated sometimes due to the angle of shooting towards the player and tracking the player movements in a smart way instead of following the player picture box. It's on my to do list for a future tutorial. I'm glad you enjoyed the tutorial.
@robertadamson62473 жыл бұрын
Hi! Well done on the tutorial. Would you have a tutorial on how to export this/save this on a server so it is viewable on web?
@scammers_hell34482 жыл бұрын
amazing tutorial but sometimes my bullets go throw the zombies without killing them
@LeittWolff Жыл бұрын
Great..proceed please
@mooict Жыл бұрын
Will do 👍🏽
@neiswfx5685 Жыл бұрын
Thanks al ot!
@arvsnacs4224 жыл бұрын
This will test my c# learned in youtube. I will take time on this and hopefully understand. Do you have a game which apply c# inheritance/interface/switch etc... just asking. Hehe. Thanks.
@mooict4 жыл бұрын
This one has a class and little bit inheritance. You can find the switch statements example in the car racing tutorial. I am working on s OOP tutorial series for unity.
@arvsnacs4224 жыл бұрын
@@mooict Thanks. Done it and applied it to your jetshooter. Next stop will be car racing.
@arvsnacs4224 жыл бұрын
@@mooict Good day. Do you have a tutorial on ASP.NET MCV? Im planning doing 1 Winform and ASP.NET learning for everyweek. Is ASP.NET the right one for making a website? Thanks.
@tyshoe2 жыл бұрын
Trying to figure out how to add more options for bullet direction. I figured that I could use vectors, or arctangent. My idea is to make the bullet travel in the direction my mouse is located, which would allow for a full 360 degree shot, rather than just 4 points. Any ideas on how to move forward?
@FooBarBash Жыл бұрын
Hey, I've experimented with this for a tank game. There's two things you need to take into consideration: where the bullet is placed in relation to the player picturebox (as you'll want the bullet to appear at a sensible location corresponding to where the player is shooting from) and how the bullet flies at a certain angle. The way I did it was to generate each picturebox with a tag like "bullet90", where 90 is the angle that the bullet was shot from. Every timer tick the game checks for objects where the tag starts with "bullet", extracts the angle part, and moves accordingly. I'm on my phone so please remind me, I'll try and send you the formulas I used later on
@FooBarBash Жыл бұрын
Right, so for moving the bullet at a certain angle, I think you can do something like private Point MoveBullet(Point startPos, float angle, int bulletSpeed) { int X = Convert.ToInt32(startPos.X + (bulletSpeed * Math.Cos(angle * Math.PI / 180))); int Y = Convert.ToInt32(startPos.Y + (bulletSpeed * Math.Sin(angle * Math.PI / 180))); return new Point(X, Y); } For placing the bullet in the first place, something like: Point centre = new Point( PbxPlayer.Left + PbxPlayer.Width / 2, PbxPlayer.Top + PbxPlayer.Height / 2 ); int radius = PbxPlayer.Width / 2; double xEdge = centre.X + radius * Math.Cos(PlayerAngle * (Math.PI / 180)); double yEdge = centre.Y + radius * Math.Sin(PlayerAngle * (Math.PI / 180)); xEdge -= bullet.Width / 2; yEdge -= bullet.Height / 2; bullet.Left = Convert.ToInt32(xEdge); bullet.Top = Convert.ToInt32(yEdge); Hope that helps
@chrisszprngr61043 жыл бұрын
Master cool
@nightcorerelax25603 жыл бұрын
Good BRO
@veztokh8285 Жыл бұрын
my bullets shoot everywhere as it should do but not when i click left, the bullet stays on the ground when i shoot while looking left.
@k-r64652 жыл бұрын
great
@sijimo Жыл бұрын
I want to program the same, but using DirectX and a backbuffer to draw the scene. Should I be using SharpDX, SlimDX, or Win2D?
@mooict Жыл бұрын
Win2D would be the ideal one.
@YnMarin Жыл бұрын
Hello friend, greetings from Colombia. I have a problem with bullets. I have the code up to there for the moment. My problem is that when I shoot = "space" the bullets do not appear as they should. And all the code is fine. Instead, white dots appear at the top where the text appears (kills, health, ammunition) this is independent of whether I shoot from the left side or from any position, apparently they look like this. I would like to know what I can do. Thank you
@mooict Жыл бұрын
Hi, I would suggest to double check the bullet positions on the code. It may be because the position is closer to the text rather than the player position that’s why it’s spawning next to the texts in the game.
@epallejohnbaptiste3933 жыл бұрын
Nice, now can you help me with my spacecraft game coding in visual studio code.
@BlackKyurem143 жыл бұрын
Hey, I think I just found an unwanted error. Everytime when an ammo box spawns and you die before collecting, the box stays there, even if you start new game. People could use that to get a huge amount of ammo, because all those boxes that you didn't collect before you died stay in the game.
@mooict3 жыл бұрын
Ah good find thank you. This is why rigorous play testing is important.
@kentonleslie-smith7771 Жыл бұрын
For anyone wanting to fix this and remove old ammo picturebox spawns, do this inside of your RestartGame() Just before goUp = false; goDown = false; goLeft = false; goRight = false; gameOver = false; Place this foreach (Control s in this.Controls) { if (s is PictureBox && (string)s.Tag == "ammo") { this.Controls.Remove(s); ((PictureBox)s).Dispose(); } }
@RockinqOnTop11 ай бұрын
shooting to mouse position?
@manaasim39773 жыл бұрын
I don't know why When I hit the zombies they don't disappear. Can you solve it.
@MASATOSHIP_Official3 жыл бұрын
Awesome tutorial, Thank you so much!! in my case, if I typed "Player.Image" it's ok(no error message), but if I typed like "player.Image", machine automatically change it to "Player.Image"(Capital "P") Where should I checked?? Anyway, it works well with "P"
@mooict3 жыл бұрын
Check in the properties window for the player, it's named player with a capital P is you change it to lower case it will work too.
@MASATOSHIP_Official3 жыл бұрын
@@mooict oh!? Thank you for your kindness. Exactly, it is!!
@dixonsworld80743 жыл бұрын
could u make it first perasoned tho??
@tamh44913 жыл бұрын
Hey i really liked your game i really enjoyed it. Can you please tell what kind of game engin you used in it ??
@mooict3 жыл бұрын
Hi, this game doesn't use any games engine to make. We use the standard .net framework Windows form in visual studio with c# to make everything from player, enemy and bullet movement and behaviour, game logic and main loops. I'm glad you've enjoyed it.
@tamh44913 жыл бұрын
@@mooict hey hi again i tried to make this game with the help of youre code and i loved it . But when i tried to add audio in the game like for bullets shooting sound i couldn't can you please help me !!!!
@mooict3 жыл бұрын
@@tamh4491 Try some of the techniques mentioned here - stackoverflow.com/questions/3502311/how-to-play-a-sound-in-c-net. I am working on a tutorial on how to embed sound in windows form games. will be up soon.
@tamh44913 жыл бұрын
@@mooict ok i will thanks again .
@tamh44913 жыл бұрын
@@mooict does this game has or uses any particular algorithm????
@mustofa25094 жыл бұрын
how to prevent zombies from coming together
@fauzinugraha20263 жыл бұрын
why my zombie and the bullet is not come out? i follow exactly same like in the video
@ahmedelhennawy67273 жыл бұрын
in the bullet script why in the Left direction takes -=speed , and the right direction takes += speed ? please help
@mooict3 жыл бұрын
When you want to move a picture box towards the left you have deduct a value from the objects left position and when moving right you add the value to the left position. This is why we use -= speed for left and += for right. Hope this helps.
@justinanderson2673 ай бұрын
Wow. I ended up doing this (because of the autosizing thing i comment about earlier) Random rnd; ammo.Left = rnd.Next((int)Math.Floor((decimal)this.ClientSize.Width / 4), (int)Math.Floor((decimal)this.ClientSize.Width * 3 / 4)); And the same for top, but I'm on a phone so I'm not typing it out again lmao
@anash.shalaby67203 жыл бұрын
hello, please reply how can I make any game where the score is the amount of time survived in seconds, like instead of a score counter i was a 0:00 counter
@3Поварёнка6 ай бұрын
please tell me why the application slows down so much when you start it? How to fix it
@mooict6 ай бұрын
Check the timer interval. Make sure it’s set to 20.
@3Поварёнка6 ай бұрын
@@mooict figured it out! It was all about the PictureBox, or rather its absence. I added a PictureBox, a BackGround and everything flew into it))
@mooict6 ай бұрын
@@3Поварёнка Great job on fixing it. 👍
@vikas_chaudhary4 жыл бұрын
Hey I'm facing error while pressing space button for shoot.. like system.NotImplementedException the method or operation in not implemented . Hw can i fix it
@mooict4 жыл бұрын
Check the source code with the one in the tutorial. I think visual studio might have included a extra line without needing to in your project. Full source is available in the description of this video.
@timobulant1942 жыл бұрын
My zombies don t spawn i don t understand why but they don t spawn i rewatched it for a few times and can t find the problem :/
@mooren_fug69614 жыл бұрын
can you drop the finished game here please🥺🥺🥺
@mohammadhamedsamandari83453 жыл бұрын
Hey there can you please suggest how to make zombies not collide with each other. At some point they get stacked on each other and I can't find a way to change it. Please reply soon I'm waiting...
@mooict3 жыл бұрын
Hi Mohammed I haven't tried the collision detection between the zombies. That would be a good improvement for this game
@mohammadhamedsamandari83453 жыл бұрын
@@mooict can you please help me and tell me how to collision detection between zombies .
@thespam53303 жыл бұрын
Yeah i will create a gta 6 using this as a base... WAIT ME GUYS
@diamond_toes108 Жыл бұрын
The private timer bulletTimer = new Timer (); says there’s an error with the timer parts anyway how to fix
@mooict Жыл бұрын
Change private timer to capital T Timer 👍🏽
@diamond_toes108 Жыл бұрын
@@mooict did that still it has still said there is an wrro
@kentonleslie-smith7771 Жыл бұрын
(1) Right near the top of the Bullet Class Script, you should have: private Timer bulletTimer = new Timer(); (2) Then, inside your MakeBullet(Form form), you should have: public void MakeBullet(Form form) { bullet.BackColor = Color.White; bullet.Size = new Size(5, 5); bullet.Tag = "bullet"; bullet.Left = bulletLeft; bullet.Top = bulletTop; bullet.BringToFront(); form.Controls.Add(bullet); bulletTimer.Interval = speed; bulletTimer.Tick += new EventHandler(tmrGame_Tick); bulletTimer.Start(); } (3) Make sure that the line "bulletTimer.Tick += new EventHandler(tmrGame_Tick);" Whatever you put in the "new EventHandler();" brackets MUST be the same name as the timer you have in Form1.cs Mooo ICT named his "BulletTimerEvent" In his Form1.cs, he has a private void MainTimerEvent I named mine "tmrGame_Tick" In my Form1.cs, I have a private void tmrGame_Tick Keeping it the same name might fix your problem
@mds61103 жыл бұрын
Currently want to die, I finished it all BUT WHENEVER I OPEN IT IT SHOWS IN TASK MANAGER BUT IT DOESN'T ACTUALLY OPEN!!!
@walter_cd24502 жыл бұрын
I typed everything correctly but some reason zombies wont follow me, why?
@mooict2 жыл бұрын
Check the tags for the zombies in the function and in the timer. See if that helps.
@CoeyDien4 жыл бұрын
I got problem. When the player picks the ammo, it doesn't add the ammo and the ammo_image won't dissappear. Where is exactly my code mistake?
@mooict4 жыл бұрын
Check the collision code between the player and the ammo picture box. There should be a if statement that checks of both of these objects collide then to remove the ammo image and add 5 to ammo
@aidanacero49124 жыл бұрын
Why does he sometimes use Example--; or Example++; and other times Example -= 1; or Example += 1;
@vo1d_v.r2872 жыл бұрын
My bullets will shoot the right way except when looking right, it shoots down
@mooict2 жыл бұрын
Check the bullet direction string when it’s being passed into the function and check the bullet class it may be there the direction is not changing when looking right.
@CLC_W3 жыл бұрын
51:15
@Majd...4 жыл бұрын
I keep getting errors... I did exactly what you did but it doesn't work.
@NadiaOfficials3 жыл бұрын
same goes for me, can't remove enemies
@wissemhajbi45482 жыл бұрын
does anyone have this? my zombies wont move until i press a key
@mooict2 жыл бұрын
I think You put the zombie movements inside of the key down event instead of the timer event.
@jordantrajkov95493 жыл бұрын
hi mate can you please reply to my comment when i shoot my bullet up or down it runs backwards from the player btw thank you so much your the best
@mooict3 жыл бұрын
Hi, for the bullet direction check if you are setting the player facing string in the key down event. Also check the bullet class where we setting the directions for the bullet see if it's same as the code in this tutorial. Alternatively the full source code is available on the website.
@jordantrajkov95493 жыл бұрын
@@mooict thank so much for your response
@shouravmandal60793 жыл бұрын
How can I make a enemy that can shoot at the player? Please help.
@mooict3 жыл бұрын
Hi, I haven't tried that yet. I think to do something like that you will feed to have a function that checks of the enemy is facing the player then create a interval for bullet time on the enemy perhaps. I like that idea of having enemies shoot at the player on the game. May be check the space invaders style game tutorial that one has a enemy bullet interval in it that fires a bullet towards the player when it reaches 0 and then starts again. Hope it helps.
@shouravmandal60793 жыл бұрын
@@mooict Thank you so much! I will try it out right away. 🙏
@sauravgaur87563 жыл бұрын
Can anybody tell me is this a console game Or OS based if OS based then which OS?
@mooict3 жыл бұрын
This is based on Windows .net Framework. We are using Windows form to make this game and it will only work with windows.
@sauravgaur87563 жыл бұрын
@@mooict okey sir
@kiquenet3 жыл бұрын
Where is te code ? Fantastic
@mooict3 жыл бұрын
Code link is in the description
@melonman12763 жыл бұрын
25:42 how to do that in Visual Basic
@varacool4562 жыл бұрын
plz i need the images
@drugkripera2004 Жыл бұрын
hotline miami 3
@duonghop10092 жыл бұрын
this clientsize is what ???
@mooict2 жыл бұрын
It’s the size of the form
@duonghop10092 жыл бұрын
@@mooict ok thanks
@unknown_user18983 жыл бұрын
My game dont start, pls help @Moo ICT
@unknown_user18983 жыл бұрын
Never mind i watch again all the tutorial and i fixed it 😅
@unknown_user18983 жыл бұрын
My bad, the game is 100% working
@mooict3 жыл бұрын
This comment thread was wild ride lol. Good job on getting it working 😊
@unknown_user18983 жыл бұрын
@@mooict thanks!
@unknown_user18983 жыл бұрын
@@mooict can i download the program?
@vallation50803 жыл бұрын
i do cheat codes programing
@varacool4562 жыл бұрын
i cnt get it
@mohmoh-tx3qf4 жыл бұрын
I can't Shoot when I press Space why Please reply Me 🧡🧡💖💖
@mooict4 жыл бұрын
Check if the key down and key up events are linked to the form. You can do this going to events inside of the properties window
@mohmoh-tx3qf4 жыл бұрын
@@mooict Thank you
@bronie183 жыл бұрын
Can you help me? it isn't working
@mooict3 жыл бұрын
What's isn't working?
@bronie183 жыл бұрын
@@mooict zombies doesn't appearing
@mooict3 жыл бұрын
@@bronie18 does it show any errors from the code?
@bronie183 жыл бұрын
@@mooict no errors have seen
@mooict3 жыл бұрын
@@bronie18 ok that's odd usually there's an error when the game doesn't load or work. Which part on tutorial are you on?
@KrissAtic4 жыл бұрын
33:26 when i tried playing the game the bullet only work down side if i shoot up the bullet stucks even in right and left
@mooict4 жыл бұрын
Check the bullet class code in your game, make sure it's the same as the tutorial. We need to make sure we tell the bullet which way it's going there are 4 conditions in the class and a function from the main game tells the class to create the bullet and towards which direction.
@ayaatkhan70543 жыл бұрын
source code send kr dain iska
@mooict3 жыл бұрын
Source code and written tutorial in the description 👍
@RockinqOnTop11 ай бұрын
Shooting to the mouses .location.X & Y
@mtbtaurangasends73143 жыл бұрын
Hi I have found a problem where the ammo box spawns contains untill u collect do u know why?
@mooict3 жыл бұрын
Yes, I found that bug too, or may be its a hidden feature. ;-)