Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Class Planning Solution1:04 with Ashley Boucher
In this video, we'll review the solution for the Classes that will be used to build out the Four in a Row game.
Hey there, let's talk about classes in Four in a Row.
When I mapped out my object organization for this project,
I considered all the different parts of the game.
First, there was the game itself.
The game has two things, players and a board.
Players have tokens that they use to play.
The board has spaces that will eventually hold these tokens.
Once I broke the game down into these different parts,
translating those parts into objects was easier.
Each of those components, the game, the players, the board, the spaces,
and the tokens, can be represented in a class.
They all have states and behaviors that are important to the gameplay.
For example, players probably have names, or a color, or
another way to differentiate between them, and tokens move left, right, or down.
So to recap, the classes we'll be using for this app are game,
player, token, board, and space.
We'll be discussing their properties and
methods in great detail in the next stage of the course.
But in the meantime, head to the next step to start building out the classes.
You need to sign up for Treehouse in order to download course files.Sign up