This is the second major development project we’ll complete together. It is designed to encourage you to utilize the knowledge and skills you’ve developed, as well as the problem solving strategies and attitudes we’ve been talking about.
Create a Game App, written in Python and using Trinket.
Specifically, your app should:
- Have an entirely graphical user interface (i.e. no printed text input besides what turtle.write())
- Use key events
- Use click events
- Have an ‘object’, i.e. a reason to play. This usually means a way to ‘win’ but you could choose to have a game that’s a little more open-ended, such as accumulating points
- Display an anmiated and congratualatory ‘Win’ screen when the user achieves the object of the game. If your game is more open-ended this could be something that happens throughout their expierience.
- Keep track of ‘state’. If, for instance, the object of your game was to collect coins, keep track of how main coins were collected. This doesn’t have to use a Dictionary like I do in chapter 4, but you’ll probably need to use a global variable of some sort.
- Display information (including relevant aspects of game state) to the user using custom turtle objects. If you use the Counter class from the videos, make sure you have created other Turtle-based classes from scratch.
- (Optional) Let the user play again or start over without using the Run button.
Additionally, your code should:
- Utilize custom modules for readability and organization
- Utilize custom functions for modularity
- Utilize definite loops (i.e.
for
loops) - Utilize multiple Turtle objects
- Use objects that are instantions of one or more custom extensions of Python’s Turtle class (NEW)
- Use at least two custom methods in your custom classes (NEW)
- Utilize a named Screen object
- Run without errors
- Be well-commented
- Be well-organized and readable
No Outside Help
On this assignment, primarily use our text and my video as a reference. Do not seek direct help from another person. Googling for small syntax information, etc. is fine but do not copy and paste any code from the internet. All code used in this exercise should be your own or heavily adapted.
Please review the university’s honor code and my stance on honor as stated in the syllabus. See me with any questions.
No TurtleChases
Yes, it would be easy to make a TurtleChase game sketch like I do in Chapter 3 of the video. No, you would not learn very much by doing that. If you use the Runner or Chaser objects in your game, make sure you have other custom objects entirely of your own design.
Milestones
Just like last time, it’s imperative that you break this assignment down into small, acheivable pieces!
Games are a very complex category of program and there’s a distinct danger of scope creep (doing more than you’d planned) and overreach (planning more than you can do). That’s why small milestones will help you: you’ll have an overview of where yo think you’re headed and where you thought you’d be, allowing you to recalibrate.
When you identify an element of your program that can be developed independently, think of it as a milestone. The various intermediate assignments you’ll have will coach you through developing a list of milestones. Include your revised list of milestones with your submission. Remember to use markdown’s checkbox notation and it’s OK to include incomplete milestones as long as you satisfy the requirements above. We all have to scale back scope on software projects.
Note: Milestones are not the same as project requirements. For instance - [ ] Be well commented
is
not a discrete, acheiveable thing, whereas - [ ] Game displays a welcome message
is.
Extras
There are lots of extra tools and concepts in my videos that you can use, like
checking for intersection between objects using recursion and screen.ontimer()
. If you choose to
do a Turtle program for your final, you’ll have plenty of chance to use these
more advanced concepts, but consider trying some of them now for an extra challenge.
Reflection
You guessed it: the reflection is an important piece of the puzzle. For this reflection the minimum lengeth I’m looking for is 250 words. Quality is more important than quanity, of course, but the number is intended to help you understand my expectations for this assignment.
To be able to properly reflect as well as complete the assignment, start early!
What to submit
- A well-formatted pull request containing a post…
- …with your drawing app embedded
- …with your 250+ word reflection included
- …with your revised milestone list included
Ideas
Think of your game in terms of its main interface paradigm
- Keyboard controlled Turtle-like objects that move around the screen and do things (recommended)
- An animated game where the user must guess a number, guess where something is, or answer a math questions using the number keys (recommended)
- A hangman-like game where the user presses a key to guess a letter. Remember, you shouldn’t be using
input()
(advanced) - Side-scrolling or down-scrolling games where the turtle is mostly stationary and the other objects move according to a timer or in response to user key presses (advanced)