Exemple #1
0
 def draw_feature(feature: str, x: int, y: int):
     if feature == Tile.empty:
         return
     first_char = feature[0]
     if feature == 'ooo' or feature == 'PPP':
         Draw.draw_cube(position=(x, y),
                        size=(1, 1, -0.2),
                        face_color=Draw.colors['white'])
     elif feature == 'iii':
         Draw.draw_cube(position=(x, y),
                        size=(1, 1, -0.2),
                        face_color=Draw.colors['orange'])
     elif first_char == 's':
         Draw.draw_cube(position=(x, y),
                        size=(1, 1, -0.2),
                        face_color=Draw.colors['white'])
         Draw.draw_round_switch(position=(x, y), color=Draw.colors['steel'])
     elif first_char == 'S':
         Draw.draw_cube(position=(x, y),
                        size=(1, 1, -0.2),
                        face_color=Draw.colors['white'])
         Draw.draw_x_switch(position=(x, y), color=Draw.colors['steel'])
     elif first_char == 'B':
         Draw.draw_cube(position=(x, y),
                        size=(1, 1, -0.2),
                        face_color=Draw.colors['light_pink'])
     elif first_char == 'b':
         Draw.draw_cube(position=(x, y),
                        size=(1, 1, -0.2),
                        face_color=Draw.colors['gray'])
     elif first_char == 't':
         if feature[2] == 't':
             Draw.draw_teleport_switch(position=(x, y),
                                       color=Draw.colors['steel'])
             Draw.draw_cube(position=(x, y),
                            size=(1, 1, -0.2),
                            face_color=Draw.colors['white'])
         else:
             Draw.draw_cube(position=(x, y),
                            size=(1, 1, -0.2),
                            face_color=Draw.colors['white'])