posted Dec 15, 2017, 6:26 AM by Konstantinovich Samuel   [ updated Dec 15, 2017, 10:33 AM ]
Please get your project proposals to me by Tuesday at the latest. I will try to approve you/ask you to change it the same day. Earlier means you have more time just in case you had a crazy idea. 

Fill out the form from yesterday. If you already did, please go back and add the "period" which was missing from the form before. 

Modify the base code such that:
I.  Every time you click/hold the mouse button, only one bullet can shoot. 

How to do this?
    You want an extra variable! 
Keep track of what the mouse was like before. You only want to shoot if the mouse was down before, but up now.

ONLY modify the mouse OR shoot procedure but not both , and add a global variable (and initialize it in setup)

II. Modify the turtle's behavior as follows:
The turtle will stay at patch 0, -10
The turtle will always face the mouse. Disable vertical world wrap, as turtles are very lazy*. 
*Turtles will use world wrap to find the shortest distance, even if that is not what we want!

III. Patch targets:
Every 180 ticks, ask one patch on the top half of the screen to turn yellow. 
Modify the bullets to change yellow patches to black.

IV. Score
Make a global score, and keep track of how many patches you hit with the bullets.
Display this as a patch label in the top left corner of the screen.

breed [ bullets bullet]
breed [ players player]

to mouse
  if mouse-inside? and mouse-down?
    ask players [ shoot ]

to shoot
  hatch 1
    set breed bullets
    set size .5
    set color white

to bullet-behavior
  fd .5
  if abs pxcor = max-pxcor or abs pycor = max-pycor [ die ]

to go
  ask players[
  ask bullets[

to setup
  set-default-shape bullets "circle"

  create-players 1 [
    set size 2

to player-behavior
  fd .1
  rt random 21 - 10