Programming Snake Game in Java Processing Tutorial -

Programming Snake Game in Java Processing Tutorial

gaspar coding
Views: 20860
Like: 376
In this video we create a snake game in less than 60 lines of java code. This is a step by step tutorial and very easy to follow. I use processing for this. With Processing you can program in a simplified version of Java. If you know Java, you will understand processing immediately.

You can download the code here:

00:24 processing
01:29 create the window
03:45 create the snake
05:24 move the snake
08:05 control the snake
09:20 snakefood
10:21 eat snakefood
11:36 create a score
12:28 food color
13:37 increase speed
14:45 let the snake die
16:13 game over text
17:43 gameplay

If you liked what you saw. Please leave me a like on the video. Thanks for watching 🙂

#java #processing #snake


  1. der Typ klingt mir irgendwie sehr deutsch 😆

  2. I'm trying to recreate this in IntellIJ IDE for an assignment and I got a question. How do I implement the key controls there?

  3. Thanks for helping me how to make my first game in processing!

  4. Hello, How would I add sound to this game? I tried but it's saying duplicate draw

  5. There is an issue with your code, whenever you press the direction equal to the direction the snake is going on start, you will no longer be able to control the snake. I thought there was something wrong with my version of it but I checked your github and it had the same problem. Any fixes for that?

  6. can you please explain the "x.size"? what does that actually mean? you didn't use any "y.size" so I'm curious to what it means, also, some of it didn't really make sense. the foodx = (int) random (0,w); isn't it suppose to be foodx = (int) random (w,0) and foody = (int) random (0,h); ? since width goes in x variable and height goes in y variable??

  7. how to write snake game by using sprites in JavaFx ? based on MVC(model, view and control) I am beginner and need help please?

  8. Nice tutorial! I'm surprised that I understood the code as a complete noob. It was very clear. Also can you make more Processing tutorials? A main menu tutorial would be great. thanks!

  9. hey u are my hero but listen can u make a seies of tutorials that will teach us concepts of java game dev so that we can make games instead of coping ur code or watching ur video

  10. cool. followed code word for word, but felt bad. Can you show the basics of game design in a different video?

  11. Its cool but in 4 mins the I afteevarray list its dont accepte

  12. How would i add a limit to the speed? Once it gets past like 3 or 4 speed increase if becomes too fast to play

  13. does the code contain classes? if yes how many?

  14. Hello, can you make the program work with 4 buttons of a virtual arduino instead of the keyboard, if so, could you please teach me

  15. key control no working ,
    immediately game start ,the game end
    , show game over

  16. You are a God.
    Thank you Thank you Thank you for this video and your work ☺️😊

  17. i was honest to god, going to start crying if i hadn't found this video. you are godsent

  18. A really good video. Very clear explanations, but I have 1 question. How do I make food not spawn inside of the snake? This seems to be happening way to often in late game when snake is already really long and it makes me angry.

  19. Awesome video
    How to find job vaccancy in this field i.e processing ? How to start preparing for this ? And what are the job opportunities in this field?
    Please reply in detail 🙏🙏🙏

  20. I’m having trouble with my code, do you think you’d be able to help me?

  21. hello, the code doesnt work on my netbeans IDE. can I know what app are you using and how to download it? Thankss

Leave a Reply

Your email address will not be published.