• Wednesday , 16 October 2019

Coding Challenge #3: The Snake Game

Code Canyon



In coding challenge, I attempt to code a p5.js version of the Snake Game.

🔗http://thecodingtrain.com/CodingChallenges/003-snake-game-p5.html
🎥 Debugging: : https://youtu.be/yUO2bWfBgN8?t=2340
🎥 2018 version! https://youtu.be/OMoVcohRgZA
💻https://editor.p5js.org/codingtrain/sketches/HkDVpSvDm

🔗https://en.wikipedia.org/wiki/Snake_(video_game)

🚂 Website: http://thecodingtrain.com/
💖 Patreon: https://patreon.com/codingtrain
🛒 Store: https://www.designbyhumans.com/shop/codingtrain/
📚 Books: https://www.amazon.com/shop/thecodingtrain

🎥 Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

🔗 p5.js: https://p5js.org
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

Original source

3d Ocean

Related Posts

22 Comments

  1. The Coding Train
    September 17, 2019 at 04:48

    If you want to know what happened during "technical difficulties"! https://youtu.be/yUO2bWfBgN8?t=1253

  2. drewestification
    September 17, 2019 at 04:48

    "we need something to call the size of this grid, I dunno what to call it.. what, R.
    R? R.. let's call it R.

    What we want to do is call it SCL"

  3. Legio
    September 17, 2019 at 04:48

    I've been learning c# and this looks very similar. What is the difference?

  4. Matdrox
    September 17, 2019 at 04:48

    How do I make the snake not go into itself? I have it set up like this: https://gyazo.com/7445ec3e5776b23f1442a4553087e184 but when the user presses both the up and the right arrow, it kills the snake because it goes to the opposite direction.

  5. ReTriX _
    September 17, 2019 at 04:48

    var s;

    function setup() {
    createCanvas(400, 400);

    s = new Snake()
    }

    function draw() {
    background(51);
    s.update()
    s.show()
    }

    function Snake() {
    this.x = 0;
    this.y = 0;
    this.xspeed = 1;
    this.yspeed = 0;

    this.update = function() {
    this.x = this.x + this.xspeed;
    this.y = this.y + this.ypseed;
    }

    this.show = function() {
    rect(this.x, this.y, 10, 10)
    fill(255)
    }
    }

    can u find any mistake?

  6. Morgan Page
    September 17, 2019 at 04:48

    Love your videos, did a Phaser version here: http://bit.ly/javascript-game-snake

  7. Fikri Rahmat Nurhidayat
    September 17, 2019 at 04:48

    You should release your this dot music to the worldwide

  8. BaronVonTacocat
    September 17, 2019 at 04:48

    very cool

  9. Ragnar Lothbrok
    September 17, 2019 at 04:48

    How do you get your rectangle if you are not even calling this shit? How do you get chrome execute it instead of just view the file? All I see is some code but I have no idea how all this is even working.
    And cut this positive crap, I wanted to see the JS expert and not a fucking clown, laughing at your own geeky jokes is something you dont want to do if you want to have any charisma at all.

  10. Akanate 458
    September 17, 2019 at 04:48

    Anyone else just come here for the satisfying typing lmao.

  11. DeepGaming
    September 17, 2019 at 04:48

    This is cool but I wish it wasn’t 25 dollars

  12. Hoang Long Nguyen
    September 17, 2019 at 04:48

    Wow! I like it! This guy is so brilliant! :3 :)))

  13. PixxlNebula
    September 17, 2019 at 04:48

    me: (getting into coding)

    also me: (copying javascript) mhm yea that makes sense

  14. Argy Pournaris
    September 17, 2019 at 04:48

    Man you are my hero!! You have coded so many things so far!!! Thank you!!!!

  15. Eduard Voinea
    September 17, 2019 at 04:48

    Great vid 👍

  16. ishak programing is my life
    September 17, 2019 at 04:48

    Next time you should code god of war 5 🙂

  17. MegaMacMan
    September 17, 2019 at 04:48

    JavaScript is starting to look easier than c++…

  18. Gopi Talari
    September 17, 2019 at 04:48

    this = open("The_Coding_Train.txt", "r")

    print(this.read())

    Hello Snake

  19. Extreme Titan2
    September 17, 2019 at 04:48

    I've taken my time to learn python and I really enjoy it but java looks great as well should I learn java next?

  20. Doc Brown
    September 17, 2019 at 04:48

    Coding Challenge #3: The Kevin Durant Game

  21. Evan Roderick
    September 17, 2019 at 04:48

    is it possible to do this in processing?

  22. 0119325
    September 17, 2019 at 04:48

    1,5x speed works

Leave A Comment

You must be logged in to post a comment.