Code Snake Game in Java

Code Snake Game in Java

Kenny Yip Coding

1 год назад

134,835 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@honzeus2010
@honzeus2010 - 30.01.2024 19:54

I can´t run the code,I think it´s because the javax.swing feature is not working, but I´ve written it exactly how you did, so I am confused a little bit.
Sorry if there is a mistake on my side, but I´d be really happy if you could help me with that.
I set up Java in vscode like you in your tutorial, but I could´ve done a mistake, so I please help me if you can.
Also thank xou for creating videos like this.

Ответить
@eddibressan8805
@eddibressan8805 - 07.02.2024 23:17

Thank you for the helpful video

Ответить
@noahfeazell3336
@noahfeazell3336 - 06.03.2024 20:20

Question: Why do you need to declare all the stuff for the frame. and then declare stuff again in another class so it can be drawn on?

Ответить
@williamkakooza4603
@williamkakooza4603 - 07.03.2024 20:25

The best way to appreciate you is by Subscribing. Thanks for this video. Can you please create a soccer game development tutorial.

Ответить
@lavaflamee
@lavaflamee - 14.03.2024 07:05

Thanks for the latest info.

Ответить
@AayushEditzzz..
@AayushEditzzz.. - 25.03.2024 17:50

AI:🗿🗿

Ответить
@Sandi22
@Sandi22 - 26.03.2024 14:22

Really cool. Thanks

Ответить
@damiaotiktok023
@damiaotiktok023 - 26.03.2024 18:07

Obrigado que tutorial incrível, ficou muito bom esse jogo. Assisti vários vídeos de como criar um jogo da cobrinha, e eu percebi que existe várias inúmeras maneiras de fazer um jogo mesmo sendo parecido, más com instruções diferentes, Obrigado vc explicou muito bem .

Ответить
@nihalchandrav.c273
@nihalchandrav.c273 - 13.04.2024 11:01

Can we do this in scanner class?

Ответить
@andrejklester5851
@andrejklester5851 - 20.04.2024 18:39

Do you have javafx experiance, it is possibile too? Snake game?

Ответить
@SiddhantShedge
@SiddhantShedge - 27.04.2024 12:42

Just did the project and it did help me clear my java fundamentals!I just had one idea,how can I increase the speed of the snake each time it eats the food?

Ответить
@timdelarboulas4796
@timdelarboulas4796 - 29.04.2024 14:26

Thank you for this video, it help to learn how write java code :) !
I try tobuild a restart function after a game over. For exemple, when you press the space key, it restart the snake game. I failed but, can you advice or give food for thought please ?
Thank you in advance.

I tried this :


boolean restart = false;

public void keyPressed(KeyEvent e) {
...
// restart function
if (e.getKeyCode() == KeyEvent.VK_SPACE && gameOver) {
restart = true;
}
}

@Override
public void actionPerformed(ActionEvent e) {
...

if (gameOver) {
gameLoop.stop();
if (restart) {
gameOver = false;
gameLoop.restart();
}
}
}

Ответить
@_I_like_kebeb
@_I_like_kebeb - 08.05.2024 09:55

the best snake video on entire you tube

Ответить
@imalkesara4466
@imalkesara4466 - 18.05.2024 13:21

Thank u <3

Ответить
@babymonster43
@babymonster43 - 01.06.2024 09:42

Thank you so much TTTOTTTT i really needed this for our final project

Ответить
@SilphiistderGoat
@SilphiistderGoat - 07.06.2024 13:43

Does this code work on BlueJ too?

Ответить
@tuxat_
@tuxat_ - 12.06.2024 05:43

thanks for explaining all the complicated parts! really helped me out a lot!

Ответить
@VietNguyen-vj4su
@VietNguyen-vj4su - 09.07.2024 08:44

Thanks! you have a knack for story telling, which is good for in this line of work (media).

Ответить
@sadiulhakim7814
@sadiulhakim7814 - 12.07.2024 14:11

Awesome

Ответить
@n0lerr1
@n0lerr1 - 15.07.2024 00:04

Thenks bro i love you

Ответить
@tonyguerra136
@tonyguerra136 - 21.07.2024 04:41

Hello Kenny, I am wondering why when I type in line #9.....frame.setVisible (true);
and line #11....frame.setsetLocationRelativeTo(null);
a "b:" and a "c:" are added automatically to the "true" and "null" like (b:true) and (c:null).
Is it there an "auto-correction command" in the VS that I can deselect?
Wonderful videos and thanks for teaching me VS and Java.

Ответить
@furkant.6681
@furkant.6681 - 02.08.2024 16:04

thankss

Ответить
@sujalsangle
@sujalsangle - 09.08.2024 18:59

Thank you for this video. it was very helpful and understandable.
Love from India ❤❤😊😊

Ответить
@mayday002-r9r
@mayday002-r9r - 19.08.2024 16:57

he i like you but java dont and thank you for letting me see thise because now i now java is not a fit form me but a fun learning experiense (love ur vids btw)

Ответить
@nehemiahpaulpichay23
@nehemiahpaulpichay23 - 20.08.2024 18:12

Is there any idea how can I put a button that says "Start Over" and the game resets from the start again. When u lose, u have to close and run it again, wonder how can I do that, beginner btw peace.

Ответить
@jorgerivera3733
@jorgerivera3733 - 06.10.2024 23:45

I get a bug on line #22 "Tile" snakeHead variable. I only get the "TIle" as abc

**Resolved.
The class path was misspelled.

Ответить
@cubes709
@cubes709 - 12.10.2024 06:01

THANK YOU this helped me make a java game for the first time YAY

Ответить
@kirby44_1votk
@kirby44_1votk - 28.10.2024 21:41

USLESS FUCKING TUTORIAL I CANT FUCKING RUN THE GAME AFTER THE LAST FRAME CODE LINE FUCK YOU YOUR GIVING FAKE TUTORIALD BITCH

Ответить
@kartikkakkar9410
@kartikkakkar9410 - 29.10.2024 10:07

what if I want to change just the color of the snake head? how can I do that?

Ответить
@08-quocat6
@08-quocat6 - 15.11.2024 16:53

i can't understand why the tile move along with snake head, help me guys!!!!! it's been a day

Ответить
@Fortnite-123y
@Fortnite-123y - 04.12.2024 03:50

Amazing Tysm I’m making this tm can’t wait 😊

Ответить
@KainatKhan-w6n
@KainatKhan-w6n - 04.12.2024 21:57

can you let me know if you implemneted any data structures if so then how many ?

Ответить
@LokeshSITO
@LokeshSITO - 27.12.2024 13:50

Great video
🙂

Ответить
@L9syy
@L9syy - 30.12.2024 21:30

can u make this game multiplayer like the same game panel has 2 snakes and they can colide to each other and compete to eat the same apple

Ответить
@WassimBenzdira
@WassimBenzdira - 31.12.2024 20:37

How I move the snake😢

Ответить
@Младкодирач
@Младкодирач - 16.02.2025 20:01

Bro i will break the pc after the second imports they delete after the last 😡🤬

Ответить
@LevelUpLounge-t6n
@LevelUpLounge-t6n - 17.03.2025 21:16

If the score is zero and it hit the wall then the program not showing any game over string on the screen. could you fix it?

Ответить
@levigabriel-p6t
@levigabriel-p6t - 01.04.2025 23:44

is it possible to run this in blueJ ?

Ответить
@mahmoudmohsen6762
@mahmoudmohsen6762 - 08.04.2025 16:22

thanks alot for your effort but i have a little suggestion could you please plan the project before we start coding this will make the vision clear and give us the opportunity to think first how to implement the ideas and think about what components to use .and again thanks for your great effort ❤❤

Ответить
@knuseski
@knuseski - 05.05.2025 15:12

You missed one condition in placeFood(). Food should not be placed where snake body is :)

Ответить
@aerilita
@aerilita - 06.05.2025 14:04

Thank you for showing it with the native Java functions without all the cumbersome libraries loading.

Ответить
@kavinkumar.2347
@kavinkumar.2347 - 01.06.2025 05:43

These videos are like the next generation coding tutorials. Very clear and useful. I have never seen clear project tutorials like this. Great, smart and professional work. 😊❤

Ответить
@renechrisfearon2172
@renechrisfearon2172 - 02.06.2025 10:06

Thanks Kenny. That was fun to make. I learnt Java years ago and have forgotten most of it - so to have a well-structured tutorial taking me through writing the code step by step helped. Based on my level of enjoyment, I'm going to both like this video and subscribe to your channel! :)

Ответить