Programming Snake Game in Java (fx) Tutorial
gaspar coding
Views: 55091
Like: 716
We will create a simple snake game in Java fx. The whole thing takes only 25 minutes and needs 200 lines of code. I have used eclipse with the plugin e(fx)clipse.
If you like what you see, please leave me a like. 🙂
If you like what you see, please leave me a like. 🙂
Do you use Intellij IDEA? Then check out the video on how to run the code in IntelliJ:
More information about how to install JavaFX:
Music:
Where I am from , Topher Mohr and Alex Elena
You can download the code here.:
Great book to learn Java “Effective Java by Joshua Bloch”:
Thank´s for watching! 🙂
#JavaFX #GameDevelopment #Snake
30.05.2022
Step by step tutorial, snake in less than 60 Java code lines. This way 🙂 https://www.youtube.com/watch?v=UpGCxdTXfSY&
Tell me what application is this pls?
liked and subbed. Hope you make more video using eclipse and JavaFx.
Very Nice
Thanks man it works
how to download fx?
Hey folks, check out my new JavaFX Tetris tutorial. Thanks for watching 🙂 https://youtu.be/boAJUSN8fOU
Very useful! Thank you for sparing your time on a GREAT video! liked and subscribed 🙂 You should definetely do more videos. !
how to play which key use to play
how to do this in netbeans??
Can u make pong in javafx too?
anyone else run into several problems when trying to run in IntelliJ. Using JDK 1.8 for FX, and I don't normally have any issues
Thank you so much, it's an awesome tutorial!! I hope you will make more cool stuff like this 🙏
Do you use Intellij IDEA? Then check out the video on how to run the code in IntelliJ: https://www.youtube.com/watch?v=vDO7hHkuzp8
A new JavaFX game tutorial is online. How to program a pong game in only 100 lines of code: https://youtu.be/HsQSqFuSTGE
Hey can I somehow run this game from another class? For example I have a menu class with 3 buttons: new game , high scores and exit can I make it that the game runs when i press the new game button? I tried Main.main(); but it does not work. 🙁
Hey there, as promised some feedback!
1. Great video, love this and please keep on doing!!
2. I'd wish to have some more explanation, why we are setting up what for you know?
+ My gameover method is somewhere wrong as the game ends after i pressed 2 different directions
May I get the souce code of the snake game ?
What algorithm did you use?
Hello! Nice video! How can i add "Best Score" Option for the best score you reached?
That's so wonderful 😁 keep up the great work
Which software use for coding??
When 2 keys are pressed quickly then snake collides with itself. Like if I press up then right or left, or down then right or left, same with left or right pressed first.
This can be seen easily when speed is reduced to 1.
Please help me correct this.
Also explain the concept of corner.
in line 152…can you explane why to add(new Corner(-1, -1)) ?
Big thanks!
May i ask which jdk are you using and are ypu using lwjgl?
It says there is something called java lang module error
can we build it without javafx application cause it is a pain in the ass to process that one
I did it in Intellij IDEA and I have an error "Error:(3, 1) java: class, interface, or enum expected" on a line "package application;". Please, can you help me to fis it?
The source code does not output
I am using netbeans
Please what do I do when I have a project delivered soon
thank you so much 😭 this is such an easy way to do a snake game 😭
chkoune je mil iset ylawej le projet? hhhhhhhhh
The most simple and understandable code ever! Love it, perfect for beginners!
how can we do it in a way the snake can leave the field and emerge from the other side?
What software are you using
Hey, thanks for the really helpful tutorial. I had a doubt though…I couldn't understand what the 'cornersize' variable represents here
Hi can u help for adding sound
how can i make a simple menu for this? like a start screen
Merci
Great 😮!..it would be helpful if you build projects even in Android studio,thank you.
Hello, what is it mean by set snake in three parts.
snake.add(new Corner(width/2, height/2);
Is this line for positioning snake at the beginning?
Why do you have to do it 3 times?
Hello! 🤩
Can this full code exactly be working in Netbeans?
Привет студентам сду)))
My code runs perfectly but the images are not showing up however I am not getting any errors. Any help?
very very amzing