Skip to content

Commit

Permalink
Improve some animations
Browse files Browse the repository at this point in the history
  • Loading branch information
fpletz committed Jun 7, 2014
1 parent 845faed commit de76251
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
33 changes: 15 additions & 18 deletions animations/multiwall_warp_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import random
import time

tick = 0.5
tick = 0.6

wall_count=acabsl.NOOFWALLS
rows=acabsl.WALLSIZEY
Expand All @@ -19,42 +19,39 @@
b = 250
shade = 3

def blank_walls():
def blank_walls(row, time):
for col in range(cols):
for row in range(rows):
for wall in range(wall_count):
send(col,row,0,0,0,0,wall);
print col,row,wall
for wall in range(wall_count):
send(col,(row-2)%rows,0,0,0,time,wall);
update()

def warp_ring(wall, row, time):
for i in range(cols):
if row < rows - 1:
send(i,row+1,r/shade,g/shade,b/shade,time,wall);
print i,row+1,wall
send(i,(row+1)%rows,r/shade,g/shade,b/shade,time*1.5,wall);
if row <= rows - 1:
send(i,row,r,g,b,time,wall);
print i,row,wall
send(i,row,r,g,b,time/2,wall);
if row > 0 and row <= rows:
send(i, row-1,r/shade,g/shade,b/shade,time,wall);
print i,row-1,wall

send(i, (row-1)%(rows),r/shade,g/shade,b/shade,time*1.5,wall);
update()


c = 0

blank_walls()
blank_walls(0, 0)

while 1:
for wall in range(wall_count):
warp_ring(wall, c, tick)

c += 1
c = c % (rows + 2)
c = c % (rows + 0)

if c == 0:
r, g, b = map(lambda x: x*255, colorsys.hsv_to_rgb(random.random(), 1, 1))
print 'Warp Color:', r, g, b

time.sleep(tick)

blank_walls()
blank_walls(c, tick*1.5)
time.sleep(tick*.8)


3 changes: 2 additions & 1 deletion animations/rainbowscroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
import random
import time

tick = 0.2
tick = 0.1

def setcol(col, r, g, b, time):
for i in range(0,acabsl.WALLSIZEY):
send(col,i,r,g,b,time);
update()

h = 0
col = 0
update()
Expand Down
1 change: 0 additions & 1 deletion animations/screw.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ def setcol(col, r, g, b, time):

time.sleep(TICK)


0 comments on commit de76251

Please sign in to comment.