Coding Challenge #94: 2048 - Part 1

Описание к видео Coding Challenge #94: 2048 - Part 1

In this multi-part coding challenge, I code the sliding puzzle game 2048 in JavaScript using canvas and p5.js. Code: https://thecodingtrain.com/challenges...

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s...

Other Parts of this Challenge:
📺 2048 - Part 2:    • Coding Challenge #94: 2048 - Part 2  
📺 2048 - Part 3:    • Coding Challenge #94: 2048 - Part 3  
📺 2048 - Part 4:    • Coding Challenge #94: 2048 - Part 4  

🎥 Previous video:    • Coding Challenge 93: Double Pendulum  
🎥 Next video:    • Coding Challenge 95: Approximating th...  
🎥 All videos:    • Coding Challenges  

References:
💾 2048: https://gabrielecirulli.github.io/2048/
🌐 2048 on Wikipedia: https://en.wikipedia.org/wiki/2048_(v...)

Videos:
🔴 Coding Train Live 122    • Coding Train Live 122: filter(), sort...  

Related Coding Challenges:
🚂 #142 Rubik's Cube:    • Coding Challenge #142: Rubik's Cube P...  
🚂 #149 Tic Tac Toe:    • Tic Tac Toe in p5.js (Coding Challeng...  
🚂 #165 Slide Puzzle:    • Coding Challenge 165: Slide Puzzle  

Timestamps:
0:00 Introducing today's topic: 2048 sliding puzzle game
2:50 How does the game work?
5:16 Let's Code!
6:10 Write an addNumber function
8:12 Use the ternary operator to pick either a 2 or 4
9:54 Draw the board
14:38 Write a slide function
18:10 Add a keyPressed function to slide the numbers
19:13 Write a combine function
25:23 Write an operate function
31:29 Check to see if a number has moved
33:09 Write a function to compare two different matrices
34:50 Conclusion and next steps

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

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

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#2048 #slidingpuzzlegame #javascript #p5js

Комментарии

Информация по комментариям в разработке