code-lauren icon indicating copy to clipboard operation
code-lauren copied to clipboard

Example program: bubble hunt

Open maryrosecook opened this issue 9 years ago • 0 comments

bubble: make-circle(random-number(0 400) 200 50)

forever {  
  set(bubble "y" add(get(bubble "y") 7))

  if mouse-button-is-down {
    mouse: make-circle(mouse-x mouse-y 1)  

    if are-overlapping(bubble mouse) {
      set(bubble "color" random-color())
      set(bubble "x" random-number(0 400))
      set(bubble "y" 200)
    }
  }

  clear-screen()
  draw(bubble)
}

maryrosecook avatar Dec 06 '15 22:12 maryrosecook