implement painter and snake.move.
add key event.