Snake Game Part 2

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • Snake Game as written in Console App in C# with Visual Studio 2015.

ความคิดเห็น • 14

  • @benjaminholm3374
    @benjaminholm3374 3 ปีที่แล้ว

    Hi! Can I get the source code? I tried making my own snake game but it is not working correctly and it would be nice to compare it to your code

  • @aliensandconspiracies7798
    @aliensandconspiracies7798 6 ปีที่แล้ว +1

    i cant use the "appleXDim = random.Next(0+2, 70-2);" unless i place the Randomizer inside the "setApplePositionOnScreen"-method.

    • @petedkcodes7261
      @petedkcodes7261  6 ปีที่แล้ว +1

      Did you define a random variable (1:44 44 into the video) and then pass the random variable into the method (2:15 into the video)?

  • @mertcanguven1326
    @mertcanguven1326 4 ปีที่แล้ว +1

    First of all great video i appreciate it. But i have a question. In the original snake game you lose the game by colliding with yourself (ex: smashing your head to your tail) too. Is it possible to implement this function to our game? I tried it but sadly i wasn't succesful. Game loads and waits for an innitial input to move but whenever i press something on keyboard it just finishes the game with 0 scores. I think this happens because we passed the values of the snake array to the next array index. Anyone with solution ?

  • @codingislife6387
    @codingislife6387 6 ปีที่แล้ว +1

    Awesome Sir. Sir please upload next lecture.

  • @germansh8641
    @germansh8641 4 ปีที่แล้ว

    when i use A W S D keys insted of the arrows its print me the letters under the game and when you press any other button the snake disapear? any solutions?
    also when you go in one direction and press the opposite key (going right and press left)the snake going left it shouldnt be like that

    • @whatisoatmeal9174
      @whatisoatmeal9174 4 ปีที่แล้ว

      You’re not supposed to use W A S D, try using the arrow keys instead

  • @phamhoa5590
    @phamhoa5590 6 ปีที่แล้ว

    thanks

  • @marcferretti
    @marcferretti 6 ปีที่แล้ว

    Any idea why whatever my snake passes it deletes whatever is on the right side of it? if i have an apple directly next to my snake on the right side and the snake moves past it the apple deletes anyway. I have been looking at my code for hours and cant figure it out.

  • @vishnueg4658
    @vishnueg4658 6 ปีที่แล้ว

    sir my food don't seen in a boundary

  • @vishnueg4658
    @vishnueg4658 6 ปีที่แล้ว

    help me please

  • @z33drew
    @z33drew 7 ปีที่แล้ว

    Hello! Could u please send the code of the methode "paintsnake". Its not working by me. The parts of the snakes are not by the snake. They are flowing around the screen. TY

    • @reflextm2157
      @reflextm2157 7 ปีที่แล้ว

      I can tell you what you have to correct. When you paint the body with the for loop you have to start at 1 this is how it should look else you are just overwriting the head :)
      //paint the body
      for(int i = 1; i < applesEaten + 1; i++)
      {
      Console.SetCursorPosition(xPositionIn[i], yPositionIn[i]);
      Console.ForegroundColor = ConsoleColor.Cyan;
      Console.WriteLine("o");
      }

  • @AleeFive
    @AleeFive 7 ปีที่แล้ว

    Thank you...it really works..