Big Light

Build Yellow Lights

# pole
for j in range(20):
    game.set_timer(j/10,block,0,(1+j),-30,'log_big_oak')

# increase x,y, yellow lights
for i in range(4):
    game.set_timer(i,block,(1+2*i),(20-i),-30,'linen_yellow') 
    game.set_timer(i,block,(1+2*i),(15-i),-30,'linen_yellow')
    game.set_timer(i,block,(1+2*i),(10-i),-30,'linen_yellow')

    game.set_timer(i,block,-(1+2*i),(20-i),-30,'linen_yellow') 
    game.set_timer(i,block,-(1+2*i),(15-i),-30,'linen_yellow')
    game.set_timer(i,block,-(1+2*i),(10-i),-30,'linen_yellow')

Function redLights()

# light_string
def light_string(x, y, z, m):
    for j in range(4):
        game.set_timer(j, block, x, (y-2*j), z, m)

#light_string(10, 20, -30,'diamond')

# pole, at x=0, z=-30
def pole():
    for j in range(20):
        game.set_timer(j/10, block, 0, (1+j), -30, 'log_big_oak')


# light_set, n sets, each string has 4 lights,

def light_set(n,m):
    for t in range(2*n):
        game.set_timer(0.1, block, t,(20+t),-30, 'log_big_oak')

    for t in range(n):
        game.set_timer(0.5,light_string, (2*t+2), 20+2*t, -30, m)

#light_set(3,'diamond')
#light_set(5,'linen_yellow')

# build diamond lights; seconds later, lights turn red

def red_lights():
    pole()
    game.set_timer(2, light_set, 10, 'diamond')
    game.set_timer(8, light_set, 10, 'linen_red')

red_lights()

See the yellow lights and red lights, they are at the same location:

Function big_light(x, z, n, colorM)

Your turn to rewrite red_lights() to be big_light(x, z, n, colorM), so we can build at location (x,z) and can put n light strings in the set, also can choose the color material. See them light up:

Reference code:

# light_string
def light_string(x,y,z,m):
    for j in range(4):
        game.set_timer(j, block,x,(y-2*j) ,z,m)
#light_string(10,20,-30,'diamond')

# big_pole
def big_pole(x,z):
    for j in range(20):
        game.set_timer(j/10,block,x,(1+j),z,'log_big_oak')

# big_light_set, n strings,
def big_light_set(x, z, n, colorM):
    for t in range(2*n):
        game.set_timer(0.1, block, (x+t), (20+t), z, 'log_big_oak')

    for t in range(n):
        game.set_timer(0.5, light_string, (x+2*t+2), 20+2*t, z, colorM)

# big_light 2 seconds, build lights; 8 seconds, light up
def big_light(x, z, n, colorM):
    big_pole(x,z)
    game.set_timer(2, big_light_set, x, z, n, 'diamond')
    game.set_timer(8, big_light_set, x, z, n, colorM) 

# some lights
big_light(20, -20, 5, 'box_lime')   
big_light(25, -10, 8, 'gold') 
big_light(40, -30, 3, 'linen_purple')

results matching ""

    No results matching ""