Countdown to Christmas Makes Challenge 2017 – Day 2

Project:

Christmas Pixel Art in Minecraft on the Raspberry Pi using Python

24×24 Pixel Art Snowman

# 24x24 Pixel Art Snowman by @KariLawler (Twitter), 02/Dec/17, v1.0
from mcpi.minecraft import Minecraft
mc = Minecraft.create()

# No Block = -1, White = 0, Orange = 1, Magenta = 2, Light Blue = 3,
# Yellow = 4, Lime = 5, Pink = 6, Grey = 7, Light Grey = 8,
# Cyan = 9, Purple = 10, Blue = 11, Brown = 12, Green = 13, Red = 14, Black = 15
pixels = [
	[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 15, 15, 3, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 15, 13, 3, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 14, 15, 3, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 15, 15, 15, 15, 15, 15, 13, 15, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 15, 0, 0, 15, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 1, 1, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 15, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3],
	[3, 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 3, 3]
]

block = 35 # wool
x, y, z = mc.player.getPos()
pixel_y = y + len(pixels) - 1
pixel_z = z - 6
for row in pixels:
	pixel_x = x
	for pixel in row:
		if pixel > -1:
			mc.setBlock(pixel_x, pixel_y, pixel_z, block, pixel)
		pixel_x += 1
	pixel_y -= 1

24×24 Pixel Art Christmas Tree

# 24x24 Pixel Art Christmas Tree by @KariLawler (Twitter), 02/Dec/17, v1.0
from mcpi.minecraft import Minecraft
mc = Minecraft.create()

# No Block = -1, White = 0, Orange = 1, Magenta = 2, Light Blue = 3,
# Yellow = 4, Lime = 5, Pink = 6, Grey = 7, Light Grey = 8,
# Cyan = 9, Purple = 10, Blue = 11, Brown = 12, Green = 13, Red = 14, Black = 15
pixels = [
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 4, 4, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 14, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 13, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 13, 13, 4, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 11, 13, 13, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, 13, 13, 13, 11, 11, 11, 11, 13, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, 13, 14, 13, 13, 13, 13, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, 13, 13, 13, 13, 4, 13, 13, 13, 14, 13, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, 13, 11, 13, 13, 13, 13, 14, 14, 13, 13, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, 14, 13, 13, 13, 14, 14, 14, 13, 13, 13, 11, 13, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, 13, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, 13, 13, 13, 13, 13, 13, 13, 14, 13, 4, 13, 13, 13, 11, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, 11, 13, 13, 13, 13, 4, 13, 13, 13, 13, 13, 11, 11, 13, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, 13, 13, 11, 11, 11, 13, 13, 13, 13, 11, 11, 11, 13, 13, 13, 13, -1, -1, -1, -1],
	[-1, -1, -1, -1, 13, 4, 13, 13, 13, 11, 11, 11, 11, 13, 13, 13, 13, 13, 4, 13, -1, -1, -1, -1],
	[-1, -1, -1, 13, 13, 13, 13, 14, 13, 13, 13, 13, 13, 13, 13, 14, 13, 13, 13, 13, 13, -1, -1, -1],
	[-1, -1, -1, 13, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 13, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 14, 14, 14, 14, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 14, 14, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
]

block = 35 # wool
x, y, z = mc.player.getPos()
pixel_y = y + len(pixels) - 1
pixel_z = z - 6
for row in pixels:
	pixel_x = x
	for pixel in row:
		if pixel > -1:
			mc.setBlock(pixel_x, pixel_y, pixel_z, block, pixel)
		pixel_x += 1
	pixel_y -= 1

Leave a Reply