Programming Snake Game in Java Processing Tutorial - playproduction.de

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

37 Comments

  1. my students and I are working through this game. We are trying to figure out if we can make each segment of the snake a different color based on the color of food it ate.

  2. der Typ klingt mir irgendwie sehr deutsch ๐Ÿ˜†

  3. 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?

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

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

  6. 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?

  7. 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??

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

  9. 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!

  10. 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

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

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

  13. 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

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

  15. 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

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

  17. You are a God.
    Thank you Thank you Thank you for this video and your work โ˜บ๏ธ๐Ÿ˜Š

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

  19. 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.

  20. 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 ๐Ÿ™๐Ÿ™๐Ÿ™

  21. Iโ€™m having trouble with my code, do you think youโ€™d be able to help me?

  22. 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.