—————————————————————————————————–
| SHOW ME SOME SUPPORT |
| |
—————————————————————————————————–
In this tutorial, we’re going to create the snake game we used to play on NOKIA mobile phones.
Snake is the common name for a video game concept where the player maneuvers a line which grows in length, with the line itself being a primary obstacle. The concept originated in the 1976 arcade game Blockade, and the ease of implementing Snake has led to hundreds of versions (some of which have the word snake or worm in the title) for many platforms. After a variant was preloaded on Nokia mobile phones in 1998, there was a resurgence of interest in the snake concept as it found a larger audience. There are over 300 Snake-like games for iOS alone.
The player controls a dot, square, or object on a bordered plane. As it moves forward, it leaves a trail behind, resembling a moving snake. In some games, the end of the trail is in a fixed position, so the snake continually gets longer as it moves. In another common scheme, the snake has a specific length, so there is a moving tail a fixed number of units away from the head. The player loses when the snake runs into the screen border, a trail or other obstacle, or itself.
And today you’re going to create the Snake game using JavaScript and HTML(or HTML5).
We won’t use any framework to build the game, just Vanilla JavaScript.
If you want to follow along with me when I type in the code, you’ll need to download the starter template from GitHub.
—————————————————————————————————–
| LINKS |
—————————————————————————————————–
DOWNLOAD SOURCE CODE + STARTER TEMPLATE:
—————————————————————————————————–
| RECOMMENDED TUTORIALS |
—————————————————————————————————–
Ping Pong Game Using JavaScript
Create a Multiple Choice Quiz Using JavaScript
Flappy Bird Game Using JavaScript
—————————————————————————————————–
| SOCIAL MEDIA |
—————————————————————————————————–
Facebook:
Twitter:
Instagram:
Website:
—————————————————————————————————–
| HASH TAGS |
—————————————————————————————————–
#JavaScript #beginners #jstutorials
#JavaScript #Games #JavaScriptGames
Nguồn: https://unknownsiberia.com/
Xem thêm bài viết khác: https://unknownsiberia.com/game/
Thank you
This Chanel is just amazing… Amazing content
why you dont use class i think that it is better.
thanks you very mutch your channel is very usefool thanks you for tutorial of game like snake and flapy bird they are cool
Source code to download in description, I appreciate it.
Is it possible to add a high score feature with player name?
Hi, Gosha Dudar stole your videos about the snake and flappy bird.
amazing sir,thanks for making this type of valuable tutorials
16:00 / 23:20
13:51
ok but how do you make a restart button functional and create a menu? pls answer me i need help here man
a like from India…….this is osm….
thanks, it was really helpful. keep up the good work
Thanks for the project
How do I adjust it so that if the worm reaches the border, it can reappear on the other side
Well explained, I'll make sure to watch all your tutorials
it kept saying addEventListener not found . why is that? i have checked it many times. can anyone help me?
thanks dude, this video so helpful
Esa serpiente está genial 😀😀
sure you made it perfectly but isnt it ironic that you copied the theme and some of the code from the google snake game
audio.png 😀
Nice one sir..please make more videos on making games using javascript and php
thank you so much! I really love it.
best code tutorial on YouTube
Good tutorial for beginners , covered everything in very little time , Awesome!!!
i can not load image in js from folder 1.png
but if this image put in html file <img src ="1.png" then it work great.
it seems like if image not in browser memory then it not working.
also it work fine if i load image from internet link
My snake isn't moving 😭
Plz help me I am getting tired with that problem plz give me some solution for this even in console there is no error
This channel is like a hidden gem.
how we can reset when it is end it has to return its orginal position
When I tried to kinda launch the game it didn't work! Only half of the screen was loaded!
snake.unshift() operation has O(n) time complexity, better to use linked list or queue for O(1) for greater performance.
I dont know why but the game is not working for me. I have followed everything of this tutorial but the snake dont moves at all.
18:50 so far great but I can't control the snake. Everytime I get to the tutorial part where I move something with an specific key from de keyboard It just ignores me. If someone knows why does this happen, please let me know. Thanks and Great Tutorial!
Subscribed !
i am trying to load the ground at 15:09 and when I open the game in the browser it does nothing just a white screen… Can you help?
Excelente tutorial, limpio, y muy bien explicado.
This is greatly explained but it has an issue when the setinterval is set to low and 2 directions are changed in one frame , suppose the snake is going down and quickly I press left and up in one frame , then the snake dies ,that's a big problem , its not a problem if it's fast. ,butttt
My game wont start, (copied your Code) i just hear the sounds..
Keren, mantap