rocinantealpha

reference / running

if

Runs a block when a condition is true, and another when it is not.

draw [  background 240  if mouse.x > 200 [ fill tomato ] else [ fill skyblue ]  circle at 200 150 radius 80]
what it draws: the whole window, 400 by 300
What the example of if draws

How to write it

if condition [ ... ]
if condition [ ... ] else [ ... ]
if condition [ ... ] else if condition [ ... ]

Related