Part 5: Matlab Programming - Build You Own Snake Game
Introduce your child to programming with our hands-on MATLAB class, where they create a fun Snake game while learning coding fundamentals, game design, and problem-solving skills.
What's included
5 live meetings
5 in-class hoursHomework
1-2 hours per week. 1-2 throughout the classAssessment
1-2 throughout the classClass Experience
Beginner - Intermediate Level
What will be taught? In this MATLAB class, I will teach learners how to build a Snake game from scratch, covering essential programming concepts such as plotting, user input handling, collision detection, and game logic. They will also learn about game design principles and how to implement a scoring system. What topics will I cover? I will cover the following topics: Basic MATLAB Syntax and Commands: Learners will become familiar with MATLAB's syntax and basic commands, including plotting functions, handling graphical objects, and using arrays. This foundational knowledge is crucial for manipulating and displaying game elements. Graphical User Interface (GUI) Elements: Students will learn how to create and manipulate graphical objects, such as rectangles and text, to design the game environment. They will understand how to use functions like rectangle, patch, and text to build and modify visual components. Game Development Fundamentals: Learners will explore the fundamentals of game development, including object movement, collision detection, and game state management. They will implement logic for controlling the Snake, detecting collisions with food and walls, and updating the game state. How is my class structured? The class is structured into five progressive lessons, each focusing on a specific aspect of game development. Each lesson includes a brief introduction, hands-on coding exercises, and practical examples. The structure is designed to build upon previous lessons, culminating in a complete Snake game project. How will I teach? I will teach through a combination of direct instruction, interactive coding sessions, and guided exercises. Each lesson will feature demonstrations of concepts, followed by practical coding activities where learners will implement what they've learned. What's my teaching style? My teaching style is hands-on and interactive, with a focus on the practical application of coding skills. Learners will receive step-by-step guidance and support as they work on their projects, fostering an engaging and supportive learning environment. How much will learners get to interact with me? Learners will have ample opportunities to interact with me through live coding demonstrations, Q&A sessions, and one-on-one support during exercises. The class will include interactive elements such as coding challenges, group discussions, and real-time feedback to ensure that students grasp the concepts and apply them effectively.
Learning Goals
Students will learn and apply fundamental MATLAB commands and functions, such as plot, rectangle, patch, and text, to create and manipulate graphical objects in the game.
Syllabus
5 Lessons
over 5 WeeksLesson 1:
Introduction to MATLAB and Basic Plotting
In this first lesson, students will become familiar with the MATLAB interface and learn basic plotting commands. They will create a simple figure and use the plot function to draw basic shapes and lines. Students will practice setting figure properties and adjusting plot limits. By the end of the lesson, they will have a basic understanding of how to create and manipulate graphical elements in MATLAB, which will serve as the foundation for more complex projects.
60 mins online live lesson
Lesson 2:
Creating the Game Environment
This lesson focuses on designing the game environment for the Snake game. Students will use MATLAB commands to draw the game area with visible boundaries and a background. They will learn how to create and place static elements, such as the game edges and initial game objects. By the end of this lesson, students will have a structured game area where the Snake will move and interact.
60 mins online live lesson
Lesson 3:
Implementing the Snake
In this lesson, students will program the Snake’s representation using MATLAB’s plot function to create a dynamic, moving snake. They will implement basic movement logic, allowing the Snake to move in response to keyboard inputs. Students will also learn how to handle direction changes and visualize the Snake as it grows. By the end of this lesson, students will have a functioning Snake that moves around the game area.
60 mins online live lesson
Lesson 4:
Adding Food and Scoring
This lesson involves adding food objects to the game and implementing a scoring system. Students will learn how to place food randomly within the game area while avoiding edges. They will also implement collision detection so that the Snake can “eat” the food, which triggers a score increase and causes the Snake to grow. By the end of the lesson, students will have a complete game loop where the Snake interacts with the food and the score updates accordingly.
60 mins online live lesson
Other Details
Parental Guidance
Students will need to download the Octave (an open-source alternative to MATLAB) in order for them to be able access the lessons and practise the MATLAB coding that is done in each lesson. Please use the link below to download and install Octave free of charge.
https://octave.org/
Language of Instruction
English (Level: A2)
External Resources
Learners will not need to use any apps or websites beyond the standard Outschool tools.
Sources
https://octave.org/
Teacher expertise and credentials
Non-US Teaching Certificate in Mathematics
Bachelor's Degree in Science from University of West Indies
Bachelor's degree in Physics
I completed a Master's degree in Physics and Engineering in Medicine which focused on the use of Matlab in engineering.
Reviews
Live Group Course
$20
weekly1x per week, 5 weeks
60 min
Live video meetings
Ages: 13-16
4-10 learners per class