Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Let's summarize what you've learned about basic programming concepts and looks at other ways you can improve the game.
Ideas to improve the program
- Use a different sprite for the player — there's a
mikethefrog.pnggraphic you can use. It's 32 pixels tall and each frame is 32 pixel wide.
- Add a life counter. Instead of simply losing points when the player runs into a bottle of poison, why not start the game with 3 lives? Each time the player hits a bottle of poision they lose one life; at 0 lives the game is over.
Information about using Treehouse Workspaces
- Using Treehouse Workspaces — complete workshop.
- Previews and snapshots — single video explaining how to create and share a workspace snapshot.
About the Project Files
You can download the project files and use your own text editor to work on this game. However, you can't just open the index.html file up in your web browser like you would with a regular web page. You need to view it through a web server in order for the images to load and the game to work. You can install a simple web server that runs right inside of the Chrome browser — it lets you select a folder on your computer containing the web files you wish to view. Click here to get the Web Server for Chrome Extension
Congratulations, you've come a long way in learning the basics of programming, and
you've built a game in the process.
Let's recap some of the main points.
Values are pieces of information like numbers, words, or
even logical statements like true or false.
We used values in our game to determine where the coins and platforms appear on
the screen, and to define the number of points the player needed to win.
Variables hold values.
Variables track information like the player score or
whether the player has won the game or not.
Commands, or functions are the blocks of code that get stuff done.
You first, define a function which tells the computer or
browser what it needs to do.
Then you call the function whenever you want to execute or
run the code inside the function.
In our game, we called functions to add platforms, coins, and stars to the screen.
Control structures change the flow of a program.
We used one type of control structure, a conditional statement, to determine
how many points the player earned or lost when they collected items in the game.
We also used a conditional statement to determine if the player had won or not.
There's a lot more to learn about programming, but
those ideas are fundamental to any programming language, and
are the ones you'll use over and over again as you become a developer.
If you'd like to continue working on this game, I've added a few ideas in
the teachers notes, below, for some places in the code you can experiment with.
With a few simple changes, you can really customize this game and make it more fun.
I've included a link to another game that you can play around with.
When you come up with a version of the game you really like,
you should create a snapshot of your Workspace and
share it with other students in the Treehouse community.
I've listed how to do that in the teacher's notes below.
Welcome to programming, I hope you've had fun in this course, and
I can't wait to see what exciting games and programs you create in the future.
But before we end, why don't you try one more quiz?
You need to sign up for Treehouse in order to download course files.Sign up