OpenGL & C++ game programming ( snake game) tutorial ( 2D ) | PART 7 | Snake body -

OpenGL & C++ game programming ( snake game) tutorial ( 2D ) | PART 7 | Snake body

The Pentamollis Project
Views: 14128
Like: 173
———-PART 7————-
This is the final video in this series. We will now finish drawing the snake body and also set the scoring system in this part.


  1. Thanks for this tuto, it was very clear and useful! However, after following every steps, it seems that my snake is moving 2 squares by 2, therefore it always happens that food can not be eat by the snake. Is there something we can do about that?

  2. Hi…Great game…I downloaded the snake archive and when i try to play the game i received an error. I tried everything.
    Can you send me the game or the source code. I need it for my school project. Thank you very much….here is my email address
    [email protected]…..and i want to talk more about this work!!! Please

  3. Thank you so much! you deserve more subscriber and view.
    btw i want to add new feature to the game like when the head hit the body, the game will end too but im not so sure how to do that. Can u give me some hint to start on that?
    Thank you again!

  4. Hi! I just wanted to add another feature to the game. How do you increase the speed of the game every time the snake eats food?

  5. I'm sorry I forgot to implement the tail collision in the tutorial.
    Put the following block of code in your drawSnake() function (after you have finished drawing the snake):

    for(int j=1;j<snake_length;j++)
    if(posX[j]==posX[0] && posY[j]==posY[0])

    This ends the game when the snake hits its own body.

  6. 'itoa','strcat','MessageBox' was not declared in this scope. How can I fix this problem ?

  7. thanks bro , this was so helpful.
    concerning the random function , i think that there is a possibility that it generates a position which is the snake's position(head or body) , so that the snake will be drawn over the food.
    if this is possible , is there anyway to avoid that ?

  8. Nice bro…I want to your source code file , please. Its my gmail account ::

  9. But what if i want to make a function to reset the game?

  10. I loved the game as I played this game many times when I was a child.
    Currently I am learning to make games using OpenGL and this is my first 2D game tutorial.
    Thanks buddy for the tutorial.

  11. hello how can i define itoa. its giving me the error that itoa cannot be used as a function.

  12. Brother i want to change the background to white color.. so that the boxes matrix wont be show up

  13. Brother make this : if snake touches its body, then the game is over

  14. thank you Ratul for helping me to code this snake 2d game but i got an error for itoa() function the message was that itoa() is not declared under the scope i don't know why??

  15. Vi cada vídeo por completo, muchas gracias!!!

  16. Great work👍👌 This is my first 2D game tutorial. I enjoyed coding for my first game with you. Thank you so much. Keep up the good work.

  17. Great tutorial series, really helped me with using glut

  18. Thanks for helping me make my first 2D game with legacy OpenGL and glut, I can now work on my mini-project for this semester.

  19. thx you very much 🙂 i know now how to draw score:)

  20. thks I followed step_by_step and I get to finish my first open_gl 2d game

  21. i do not have the function itoa :c how i can d that in this case?

Leave a Reply

Your email address will not be published.