 	
 	draw_eye = (eye, x, y)->
 		ctx.beginPath()
+		x += eye.offset_x * radius
+		y += eye.offset_y * radius
 		switch eye.type
 			when "open"
 				ctx.arc(x, y, radius/6, 0, TAU)

	canvas.height = size + spacing
	
	draw_emoji(ctx, emoji, canvas.width/2, canvas.height/2, size)
	
gui = new dat.GUI()
gui.add(emoji.mouth, 'smile', -1, +1).name('Smile')
gui.add(emoji.mouth, 'open').name('Open')
# gui.add(emoji.mouth, 'tongue', {
# 	"(Inside mouth)": 0,
# 	"Out downwards": 1,
# 	"Out upwards": -1,
# 	"Out downwards less": 0.5,
# 	"Out upwards less": -0.5,
# }) # doesn't work, it gives strings
# gui.add(emoji.mouth, 'tongue', {min: -1, max: 1, step: 0.5}) # doesn't work, it's treated as a dropdown
gui.add(emoji.mouth, 'tongue', -1, +1).step(0.5)
gui.add(emoji.eyes.left, 'type', {"Open": "open", "Wink": "wink"}).name('Left Eye')
gui.add(emoji.eyes.right, 'type', {"Open": "open", "Wink": "wink"}).name('Right Eye')


canvas = document.createElement("canvas")



make_random_emoji = ->
	choose_random = (array)->
		array[~~(Math.random() * array.length)]
	
	random_eye = ->
		type: if Math.random() < 0.3 then "wink" else "open"
		offset_x: (Math.random() - 0.5)
		offset_y: (Math.random() - 0.5)
	eyes:
		left: random_eye()
		right: random_eye()
