Learn How to Code a Classic Snake Game (Part 1)
In this series of videos I will code a Classic Snake Game from start to finish, talking you through my entire thought process along the way because I really do believe this type of project is one of the best way for new programmers to learn.
I am going to be using the MIT Scratch platform, but most of the methods and coding principles I use to create this snake game will be applicable in just about any coding platform or language (e.g. Java, Python, etc.) although different languages/platforms will have their own quirks and their own methods for working with graphics. I chose the MIT Scratch platform because it is highly visual and easy to get started with making it a great choice for learning the basics of programming. It's also a free platform so anyone can take this project for a spin and start to learn.
Play a final version of this game: https://scratch.mit.edu/projects/631302216/
Because of the length, I've divided this snake game tutorial into 4 parts:
Snake Game Part 1: https://youtu.be/5ezXsDogFiU
Snake Game Part 2: https://youtu.be/Ox3YUBP7Vmk
Snake Game Part 3: https://youtu.be/JCVOItQNPr4
Snake Game Part 4: https://youtu.be/bHKqp6hcYuQ
Some key moments in this video:
1:39 - Advice for when starting a new project
2:16 - Breaking the stage up into a grid
4:50 - Using the Pen Extension
9:25 - Using Custom Blocks (Functions) for more Efficient Code and to speed up workflow
16:24 - Lightning fast blocks/functions with Run w/o Screen Refresh
17:13 - creating the head of the snake
23:02 - Using a game flow variable
24:30 - Commenting your Code
30:35 - Using Broadcast Messages
35:24 - Coding the Snake Movement
36:05 - Thinking Ahead and Making Your Game more Flexible
38:24 - Forever Loops and Frame Rate
41:06 - Controlling snake direction and movement with variables tied to events (key presses)
45:00 - A Happy Accident
46:08 - Embrace Your Mistakes
46:42 - Watch for Game/Code Flow Mistakes
47:52 - Adjusting Player Speed
50:34 Cleaning Up and Improving Your Code as you Go
51:00 Using Grid Cell Size for More Flexibility
1:00:06 The payoff, changing grid/board size
Thanks for watching!
cheers,
Greg
Видео Learn How to Code a Classic Snake Game (Part 1) канала Learning With Greg
I am going to be using the MIT Scratch platform, but most of the methods and coding principles I use to create this snake game will be applicable in just about any coding platform or language (e.g. Java, Python, etc.) although different languages/platforms will have their own quirks and their own methods for working with graphics. I chose the MIT Scratch platform because it is highly visual and easy to get started with making it a great choice for learning the basics of programming. It's also a free platform so anyone can take this project for a spin and start to learn.
Play a final version of this game: https://scratch.mit.edu/projects/631302216/
Because of the length, I've divided this snake game tutorial into 4 parts:
Snake Game Part 1: https://youtu.be/5ezXsDogFiU
Snake Game Part 2: https://youtu.be/Ox3YUBP7Vmk
Snake Game Part 3: https://youtu.be/JCVOItQNPr4
Snake Game Part 4: https://youtu.be/bHKqp6hcYuQ
Some key moments in this video:
1:39 - Advice for when starting a new project
2:16 - Breaking the stage up into a grid
4:50 - Using the Pen Extension
9:25 - Using Custom Blocks (Functions) for more Efficient Code and to speed up workflow
16:24 - Lightning fast blocks/functions with Run w/o Screen Refresh
17:13 - creating the head of the snake
23:02 - Using a game flow variable
24:30 - Commenting your Code
30:35 - Using Broadcast Messages
35:24 - Coding the Snake Movement
36:05 - Thinking Ahead and Making Your Game more Flexible
38:24 - Forever Loops and Frame Rate
41:06 - Controlling snake direction and movement with variables tied to events (key presses)
45:00 - A Happy Accident
46:08 - Embrace Your Mistakes
46:42 - Watch for Game/Code Flow Mistakes
47:52 - Adjusting Player Speed
50:34 Cleaning Up and Improving Your Code as you Go
51:00 Using Grid Cell Size for More Flexibility
1:00:06 The payoff, changing grid/board size
Thanks for watching!
cheers,
Greg
Видео Learn How to Code a Classic Snake Game (Part 1) канала Learning With Greg
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
How to EASILY post photos to Instagram from your Computer (Mac or PC)Create Eye-Popping 3D Photos for Facebook in Minutes with Photoshop!How to Draw a Squirrel Speed Art in Photoshop (simulating a pencil sketch)Canva Quick Start: Over 20 Super Useful Canva Tips, Tricks, and Tools!How to Create Realistic Flames with Photoshop CCEasily Drawing Forests (or other stuff) on your Fantasy Maps with Photoshop's Puppet Warp ToolHow to Create the Ultimate Pinterest Template using Photoshop Layer CompsEditing Food Photography with Lightroom and Photoshop CC - What would Greg do? -- Episode 01How to Use Frames in Canva to Create Smart Reusable TemplatesHow to Edit a PDF with Canva (No Adobe Acrobat Required -- It's Easy!)A Master Tutorial on the Curvature Pen Tool in Photoshop and IllustratorQuick Search Keyboard Shortcut in Canva: Forward Slash /Magic Timesaver!Turning a Photograph into a cool animation with PlotagraphHow to Create Custom Blocks (Functions) in MIT ScratchThe Easy 4 Step Method for How to Create a Book Cover for Amazon KDP or Any Publishing PlatformTexture vs. Clarity in Lightroom & Camera Raw: Which one is best?Learn How to Code a Classic Snake Game (Part 2 of 4)11 Adobe Lightroom CC Tricks You Need to KnowChanging the Color of Anything in Photoshop: Part 2, Understanding RGB ColorMastering Precision Edits with the Lightroom Range Mask Tool