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 0:00 you've built a game in the process. 0:05 Let's recap some of the main points. 0:07 Values are pieces of information like numbers, words, or 0:10 even logical statements like true or false. 0:13 We used values in our game to determine where the coins and platforms appear on 0:16 the screen, and to define the number of points the player needed to win. 0:20 Variables hold values. 0:26 Variables track information like the player score or 0:28 whether the player has won the game or not. 0:31 Commands, or functions are the blocks of code that get stuff done. 0:34 You first, define a function which tells the computer or 0:39 browser what it needs to do. 0:42 Then you call the function whenever you want to execute or 0:44 run the code inside the function. 0:48 In our game, we called functions to add platforms, coins, and stars to the screen. 0:50 Control structures change the flow of a program. 0:55 We used one type of control structure, a conditional statement, to determine 0:58 how many points the player earned or lost when they collected items in the game. 1:03 We also used a conditional statement to determine if the player had won or not. 1:08 There's a lot more to learn about programming, but 1:14 those ideas are fundamental to any programming language, and 1:16 are the ones you'll use over and over again as you become a developer. 1:19 If you'd like to continue working on this game, I've added a few ideas in 1:23 the teachers notes, below, for some places in the code you can experiment with. 1:27 With a few simple changes, you can really customize this game and make it more fun. 1:32 In addition, 1:37 I've included a link to another game that you can play around with. 1:38 When you come up with a version of the game you really like, 1:41 you should create a snapshot of your Workspace and 1:43 share it with other students in the Treehouse community. 1:46 I've listed how to do that in the teacher's notes below. 1:49 Welcome to programming, I hope you've had fun in this course, and 1:53 I can't wait to see what exciting games and programs you create in the future. 1:56 But before we end, why don't you try one more quiz? 2:01
You need to sign up for Treehouse in order to download course files.Sign up