How to code a Snake game using html and javascript

Опубликовано: 18 Февраль 2026
на канале: Raizensoft
538
8

⭐ Download full source code:
https://github.com/rimmontrieu/2d-sna...

⭐ Play the game online: https://2dsnakegame.netlify.app/

In this video I create the classic Snake game using Vim and the browser API. The render engine is Pixi.js and I use some techniques to make the movement as smooth as possible.

00:00 Create new project with vite
01:08 Config vite project
02:14 Build the app structure
03:20 Install libraries
03:57 Create SnakeGame class
07:37 Make tiling grid
09:47 Setup other components
12:01 Create TheSnake class
14:31 Create SnakePart class
20:44 Improve TheSnake class functions
27:29 SnakeGame routines
41:22 Hit detection
47:49 GameOver state
51:15 Debugging
56:14 Final test

⭐ Thank you for watching the video
⭐ Don’t forget to LIKE & SUBSCRIBE

#asmr #gamedev #programming #javascript