3 challenges: Use a window size of 400 by 400 pixels. You can work solo or in a group.
In the first week we learned about Quipu, a numeric recording system from the Andes in South America.
This week we jump far forward to the 1800s to look at an industrial weaving process, with the Jacquard Loom.
For this challenge, you will be coding a simple AI character that will chase a player.
The player is a creature in a hostile environment. It needs to collect apples in order to survive. There is an enemy creature that is trying to capture the player. It continually moves toward the player no matter what the player does. If it captures the player by moving into its space, it has vanquished the player and the game ends.
This section contains bonus goals. It is particularly encouraged for math/CS majors but everyone is welcome to try to accomplish these. Challenge yourself.
A. Add in a reset() function that runs when the player is captured. The game should start over.
B. Add in a bat. The bat moves around to an adjacent space randomly each time draw runs. If it touches the player, the bat drops the player at a random position on the screen (it could even be on top of the monster!) and then randomizes its own location and appears somewhere else on screen.
C. Add a goal, a green apple, randomly placed at start. Create a score variable. When the player reaches the green apple their score increases by 1. Then move its location and draw the apple somewhere else randomly on the level. And lastly, speed up the enemyAI by 1!
D. If the player is captured, use println to print out the final score and reset the score as the game begins again.
Read Chapter 8 - Objects. This is new material.
Be sure to re-read any previous chapters if you are feeling uncertain about any of the material covered.
Punch Card Programming on ComputerPhile
Review Videos:
Intro to Functions and Objects - this video points to what we’ll be studying next: objects
While loops - also contains if (conditionals)
This is required of all students.
If we don’t get the chance to meet during class today, email me to set up a 1-on-1 10-15 minute check-in meeting during my office hours, next Monday or the following Monday. October 3 I will hold office hours online and October 10 can be online on Zoom or in-person. We will review your progress in-class as well as your current grades and I can answer questions you may have.
Next week I will assign a midterm project. We will also have a midterm exam in a few weeks.