Color Frames

Remember how quilt is generated? Each second a larger frame is made outside the previous one in the same x-y plane. If, in the timer, I increase z value, the new frame will use the updated z after each second. Then all the different colored frames won't be in one x-y plane anymore, they will separate along z-axis, let's check it out:

frames along z

# frames along z (increase z in timer)
# framesZ
def framesZ(x,y,z, s,m):
    for i in range(-s, s+1):
        block(x+i, y+s, z, m)
        block(x+i, y-s, z, m)
    for j in range(-s, s+1):
        block(x-s, y+j, z, m)
        block(x+s, y+j, z, m)

    if s < 10:
        game.set_timer(1, framesZ, x, y, z+1, s+1, m+1)

framesZ(0,20,-40,0,46)

See the final frameZ:

framesXY, check out this structure: same size frames, different color, they appear one by one from the down left side to the up right side:

# framesXY

def framesXY(x,y,z,s,m):
  for i in range(-s, s+1):
    block(x+i, y+s, z, m)
    block(x+i, y-s, z, m)
  for j in range(-s, s+1):
    block(x-s, y+j, z, m)
    block(x+s, y+j, z, m)
  if m < 59:
    game.set_timer(1, framesXY, x+2, y+2, z, s, m+1)

framesXY(20,5,-40,3,46)

results matching ""

    No results matching ""