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
09.05.2022
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.
der Typ klingt mir irgendwie sehr deutsch ๐
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?
Thanks for helping me how to make my first game in processing!
I or symbol?
Hello, How would I add sound to this game? I tried but it's saying duplicate draw
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?
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??
16:13 is wow
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
More Processing? Let's create a Flappy Bird game: https://youtu.be/UIlzIwqmOYE
Thanks for watching ๐
Awesome tutorial. It was really fun one
how to write snake game by using sprites in JavaFx ? based on MVC(model, view and control) I am beginner and need help please?
thanks
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!
how did you make the code go the right and make t angled at 11:17?
Excellent explanation, thanks!
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
cool. followed code word for word, but felt bad. Can you show the basics of game design in a different video?
Its cool but in 4 mins the I afteevarray list its dont accepte
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
Extremly good tutorial thanks
does the code contain classes? if yes how many?
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
key control no working ,
immediately game start ,the game end
, show game over
You are a God.
Thank you Thank you Thank you for this video and your work โบ๏ธ๐
Cute accent ๐
i was honest to god, going to start crying if i hadn't found this video. you are godsent
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.
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 ๐๐๐
Thanks for the tutorial!
Thank you
Iโm having trouble with my code, do you think youโd be able to help me?
Can you make a classic fishing game?
hello, the code doesnt work on my netbeans IDE. can I know what app are you using and how to download it? Thankss
good job ๐
Thanks for the tutorial!