processing 如果能下雨就好了

  • Based on Coding Challenge #4

1. 雨滴

  • line(x, y, x, y+len)
  • 雨的长度.
  • x = random(width)
  • y = random(-500, -50)
  • 雨的位置
  • y = y + yspeed
  • 下落速度

2. 变化

  • z = random(0, 20)
  • 雨的远近.
  • thick = map(z, 0, 20, 1, 3)
  • 雨的厚度
  • stroke(191+z, 254, 236)
  • 雨的颜色

3. 真实

  • yspeed = yspeed + grav
  • 重力加速度.
  • if (y > height) {}
  • 连续的雨

4. 控制

  • int de = floor(map(mouseY, 0, height, 100, 0))
  • delay(de)
  • 哦在这停顿

你可能感兴趣的:(processing 如果能下雨就好了)