Next Steps
Extra Challenges
Now that you've finished up the project, here are some challenges and improvements that you might want to try:
Use Different Images
If you don't like the sprites we've used for the player and the treasure, you might want to try finding your own images to use. You'll need to have a link to whichever image you want to use. Here are some tips to help you figure out how to get image links.
Link to An Online Image
- https://www.wikihow.com/Get-the-URL-for-Pictures
- https://www.lifewire.com/copy-image-web-address-url-1174175
Link to An Image On Your Computer or Phone
Add Extra Text to Game Over Screen
Right now, the game over screen does not actually tell the player to press the Enter key to restart. Using what you've learned about the text() function, see if you can add a message to let the player know about the restart option. Maybe you can write something like "Press Enter to Play Again."
Change the Time Limit
Is 10 seconds enough time to rack up a high score? See if you can give the player a different time limit!
Change the Screen Size
If you'd like, see if you can make the play screen bigger. Can you remember where in the code we set the play screen size?
Change the Keyboard Controls
In our game, we controlled the character by using the four arrow keys. However, in many computer games, players can use the WASD scheme to move. W is up, A is left, S is down, and D is right.
If you want to use the letters, you can just replace the arguments we pass to the keyIsDown() function calls. To figure out the numeric key code for a letter, you can go to this site and press any key: http://keycode.info/
For example, here's what happens when I press the W key:
The number 87 is the key code, so if we wanted to check if the W key is pressed, we could write:
if(keyIsPressed(87))
You can do this process for any key that you'd like to try.
More Courses and Resources
If you'd like to continue learning more about programming and game development, here are some other Teachable courses you might consider:
Introduction to Programming through Video Games: https://bit.ly/3dCVXac
Continue your game development journey and dive deeper into coding by building a more advanced version of the game you've just made, complete an enemy that displays some basic artificial intelligence. Learn more about the basics of JavaScript and p5.js in greater detail.
Confident Programmer Success: How to Create a Computer Science Study Schedule: https://bit.ly/3qBzAXd
Learn strategies and study tips to help you become a better computer science student. Whether you're studying programming or game development on your own, or you're taking a course in school, or maybe even hoping to learn new career skills, this course will help you learn more efficiently and plan your study time more effectively.
The Fun of Computer Science: Learn Java Programming by Playing Video Games! : http://bit.ly/2T8r6p4
A free, work-in-progress about how to learn the Java programming language (different from JavaScript!) using your favorite video games as examples. Java is another programming language that is useful for Android app development, among other things, and is a great skill for any developer.
Confident Programmer Debugging Guide: http://bit.ly/2ItEQ8l or https://amzn.to/30r09RV
This guide will help you to boost your debugging skills.
Debugging is a critical skill for software developers and programmers, but it is not often taught well in many computer science classes. This guide gets you started on your way to becoming a more effective and confident debugger.
Next time you face a list of pesky bugs and feel frustration rising, check this guide to help keep crashes from becoming showstoppers!
Course Survey
Thanks so much for taking this course! If you would like to provide feedback, please fill out the survey form below. Or you can send an email to: [email protected]