My 10 year old has had fun coding pixel art with Kano's online editor. Kids love pixel art and coding pixel art designs is a great way to get them thinking hard while having fun.
It's Hour of Code week so we've been trying out some of the activities at home, there's lots there to encourage kids who already code to try something new. One of the activities is Kano's Pixel Hack which teaches kids to code cool pixel art by typing code into a friendly and helpful online editor.
My kids have also been completing Elbrie's Pixel Art Advent calendar. They love creating the designs in Minecraft, but after trying Pixel Hack my 10 year old and I had a go at coding one of the designs.
Kano is a Raspberry Pi-based computer for kids and beginners and it has its own coding tools. The Pixel Hack hour of code activity (and other activities) can be completed in a web browser without needing a Kano computer kit.
The basic idea is that you can draw coloured rectangles from different starting locations. We chose the Christmas bell design from the advent calendar and worked out that the design would just about fit onto the canvas with 40x40 pixels.
We worked in horizontal lines across the screen creating rectangles corresponding to rows of the same colour pixel. We worked a colour at a time. There was quite a bit of calculating involved to get the pixels to appear in the right locations but luckily I had my son to help (it would appear that his mental arithmetic is often faster than mine, but I can still type faster!)
We'd recommend working through the Pixel Hack Hour of Code before attempting your own design. Then you can head to the Kano Playground to try your own pixel art.
You're welcome to copy our code and paste it into the Kano editor to draw the bell:
stroke 0 moveTo 225, 0 colour yellow rectangle 40, 40 moveTo 185, 40 rectangle 120, 40 moveTo 145, 80 rectangle 200, 40 moveTo 145, 120 rectangle 200, 40 moveTo 105, 160 rectangle 280, 40 moveTo 105, 200 rectangle 280, 40 moveTo 65, 240 rectangle 360, 40 moveTo 65, 320 rectangle 360, 40 moveTo 25, 400 rectangle 440, 40 colour orange moveTo 65, 280 rectangle 360, 40 moveTo 25, 360 rectangle 440, 40 moveTo 185, 440 rectangle 120, 40 moveTo 225, 480 rectangle 40, 40 color white moveTo 265, 80 rectangle 40, 80 moveTo 305, 160 rectangle 40, 40 moveTo 265, 280 rectangle 40, 40 moveTo 345, 280 rectangle 40, 40 moveTo 305, 360 rectangle 40, 40 moveTo 385, 360 rectangle 40, 40
Why not have a go at creating one of the other designs from the Pixel Art Advent Calendar?
We're also looking forward to Kano's Creative Computing Kits project on Kickstarter. This includes a physical pixel grid of programmable RGB LEDs which is available to pre-order from Kano (due April 2017.)