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.
Downloading and Running the Project Files
Because of how the Phaser.JS library handles files, you need to be running a web server locally to view a working copy of this project. You can't just open the index.html file in your web browser as you might a basic HTML page. There are several simple ways to get a web server up and running on your computer:
- The Web Server for Chrome is an easy-to-install extension for Chrome that lets you select a folder on your computer (like the folder with the game files in them) and deliver them through a basic web server. This is probably the easiest way to get started — but you'll need to use the Chrome web browser.
- If you don't want to use Chrome, check out a simple guide for getting a local web server set up for several other methods.
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