Assignment Set 8

p5.play Intro

8.0 Exercise — p5.play Basics

Create a sketch that uses p5.play that creates a sprite wherever the mouse is clicked. If the sprite is created in the top half of the screen, make go down. If it's created in the bottom half of the screen, make it go up.

Be sure to use the blank p5 play project template here.

8.1 Exercise — p5.play Collisions

Create a sketch where the player can control a sprite that can move up, down, left and right. Create two randomly positioned, randomly colored sprites. When the player collides with one of them, turn the player the same color as the sprite it collides with. Also, delete the pick-up after collision.

Be sure to use the blank p5 play project template here.

8.2 Project — Avoid Game

Use what we learned about keyboard input (or using mouse input from earlier in the semester), detecting collisions, and the allSprites array to create a simple "game" where you control a sprite avoiding (or collecting) other sprites. Do the following:

  • Include at least five other sprites besides the player in your "game."
  • Consider either using wrapping blocks, or using a spawner.
  • Make something meaningful happen when collisions occur.
  • Try to make it somewhat challenging but not impossible.
  • Consider varying the size, speed and frequency of each "enemy".
  • Don't worry about keeping score.
  • In the beginning of your code, include a few comments about how to play your game.

Projects will be graded on both creativity and implementation.

Be sure to use the blank p5 play project template here.

To hand in your work get the URL from the editor and link to it from your index.html page. To receive credit, it must be uploaded by class on the date specified. Label it clearly. Here is help if you need it.