code-lauren
code-lauren copied to clipboard
Example program: bubble hunt
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)
}