Snake Game built with LWC, without Canvas -

Snake Game built with LWC, without Canvas

Salesforce Developers
Views: 438161
Like: 1468
We build the classic Snake game using Lightning Web Components and then deploy it to Salesforce, Heroku, and GitHub Pages.
Source Code:

Play the Game on Heroku –
Play the Game on GitHub Pages –
Make sure you join our Telegram Channel
Follow Aditya Naag Topalli on Twitter or LinkedIn

00:00:00 – Start
00:00:15 – Introduction
00:02:02 – The inspiration
00:04:59 – Whiteboarding the Component Architecture
00:08:37 – Creating the Game Area
00:22:59 – Fixing Infinite renderedCallback() calls
00:26:49 – Creating and moving the snake
00:39:09 – Adding Keyboard Controls
00:43:21 – Optimizing for performance
00:48:06 – Adding Food Particles
00:53:19 – Making the snake longer
01:07:06 – Adding “Game Over” logic
01:09:28 – Deployment to Salesforce
01:12:25 – Deployment to Heroku and GitHub Pages

This video is from our streaming platform, Trailhead Live. Join us there to get Live learning content where your questions can be answered in real-time and view the learning content as it happens.


  1. watching this in 2024 and still useful..

  2. when i run this for loop it could not display in the format of this{0,0} it display in the format of {$x}{$y} format why

  3. Почему игра только на одного? Мне для курсача нужно по локалке (2 игрока)

  4. Thanks Aditya for the video, great learning from this. Hope to see similar videos in the future.

  5. Hi thanks a lot for such a lovely session , there is one challenge which i am facing as soon as i eat the food and move the snake in the same direction is says game over can u help why its happening

  6. Awesome clarity in explanation. Thanks Aditya! Hope to see more of these videos in future!

  7. Hey Adi, Telegram group link not working
    please update if possible

  8. Yung camera man nyo nakiki tahan na kayo


    العتبةالعباسية المقدسة

    ﻵ اله الا الله محمد رسول الله على ولى الله

    الله الله بسم الله الرحمن الرحيم
    و ﻵ حول و لا قوة الا بالله العلى العظيم

    ﻵ اله الا الله محمد رسول الله على ولى الله
    Like Share and Subscribe Channels

    Ali Imran Lahore Pakistan
    What's app : 03224393996
    Cell : 03234713661 .

  10. Loved it 🙂 thanks a lot for sharing your knowledge.

  11. Very well explained. I always had a desire to understand better how Node.js could act together with Salesforce Ecosystem, anxious for the next videos and thanks for this excellent content.

  12. Those who disliked are still working on VF pages

Leave a Reply

Your email address will not be published.