Tests examples for the miniworldmaker engine https://www.miniworldmaker.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
miniworldmaker_cookbook/snippets/11 arrays/1101_background_to_array.py

11 lines
306 B

from miniworldmaker import *
board = Board()
arr = board.background.to_colors_array()
print(arr)
for x in range(len(arr)):
for y in range(len(arr[0])):
arr[x][y][0] = ((x +1 ) / board.width) * 255
arr[x][y][1] = ((y +1 ) /board.width) * 255
board.background.from_array(arr)
board.run()