require.def [
'toy2d/debug',
'toy2d/canvas',
'toy2d/canvas_scale',
],
(Debug, Canvas, CanvasScale) =>
PI = Math.PI
class Toy
constructor: () ->
@canvas = new Canvas
new CanvasScale(@canvas.jquery(),.8)
@canvas.init_centered(5.0)
@width = @canvas.draw_width
@height = @canvas.draw_height
@degree = 0
this.start()
start: () -> setInterval( (() => this.step()), 33)
step: () ->
@canvas.clear()
if ++@degree == 360 then @degree = 0
thick = .025
thin = .005
a = @degree * 2 * PI / 360
x = Math.cos(a)
y = Math.sin(a)
@canvas.ctx.lineWidth = thin