kopia lustrzana https://github.com/villares/sketch-a-day
Update sketch_2020_03_25a.pyde
rodzic
f307dbf3d0
commit
8bcc4879ca
|
|
@ -1,13 +1,12 @@
|
||||||
# Based on https://www.openprocessing.org/sketch/862451
|
# Based on https://www.openprocessing.org/sketch/862451
|
||||||
# by @takawo https://www.openprocessing.org/user/6533
|
# by @takawo https://twitter.com/takawo
|
||||||
# Missing drawingContext shadowColor shadowBlur :(
|
|
||||||
|
|
||||||
from random import choice
|
from random import choice
|
||||||
|
|
||||||
movers = []
|
movers = []
|
||||||
mover_num = 350
|
mover_num = 350
|
||||||
pallete = ["#DAFFDA", "#DEFF0C", "#3AFFA8", "#A8FFCC",
|
pallete = ["#DA00DA", "#DE000C", "#3A00A8", "#A800CC",
|
||||||
"#0A1DFF", "#CD46FF", "#C0AEFF", "#838CFF"]
|
"#0A1D00", "#CD4600", "#C0AE00", "#838C00"]
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
global ns, offset
|
global ns, offset
|
||||||
|
|
@ -30,7 +29,7 @@ def setup():
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
global ns
|
global ns
|
||||||
fill(0, 10)
|
fill(0, 2)
|
||||||
noStroke()
|
noStroke()
|
||||||
rect(0, 0, width, height)
|
rect(0, 0, width, height)
|
||||||
if frameCount % 1000 == 0:
|
if frameCount % 1000 == 0:
|
||||||
|
|
@ -66,7 +65,7 @@ class Mover:
|
||||||
self.vel = PVector(cos(angle) * self.len, sin(angle) * self.len)
|
self.vel = PVector(cos(angle) * self.len, sin(angle) * self.len)
|
||||||
self.pos.add(self.vel)
|
self.pos.add(self.vel)
|
||||||
isBorder = False
|
isBorder = False
|
||||||
if not (offset < self.pos.x < width - offset or
|
if not (offset < self.pos.x < width - offset and
|
||||||
offset < self.pos.y < height - offset):
|
offset < self.pos.y < height - offset):
|
||||||
isBorder = True
|
isBorder = True
|
||||||
|
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue