Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
The Assignment1:17 with Kenneth Love
Here's your game-based quest!
Create a game with a 2-dimensional map. Place the player, a door, and a monster into random spots in your map. Let the player move around in the map and, after each move, tell them if they've found the door or the monster. If they find either the game is over. The door is the win condition, the monster is the lose condition.
Well, you've almost made it through another Python course here at Treehouse.
But, you know that we can't just part ways like that.
So, let's make another game together.
This one is definitely more complicated.
So we're gonna work through it together, over a couple of videos.
I've planned it out, so let's go over the requirements.
First, this is going to be a 2D, maze-like game.
We'll put the player in a random room in our grid, put a monster in a random room.
And put a door in a third random room.
Then, the player will get to move around the maze,
trying to find the door so they can leave.
So, you need to have a grid of rooms.
This would probably be best done as a collection of coordinates,
maybe stored as tuples.
Then you need to put the player, a door, and the monster into random rooms.
We'll talk about the choice method from the random library,
in a bit in case you want to use that, to pick your starting locations.
Then you need to let the player move around.
Don't let them go off the edges of the map.
And finally, you should tell them if they get eaten by the monster, or
if they escape.
If you want some extra challenge, draw a visual map and
keep track of where they've been.
And show them some bread crumbs, so they don't double back accidentally.
All right, good luck, we'll talk about random.choice in our next video
You need to sign up for Treehouse in order to download course files.Sign up