我已经使用画布在 CoffeScript 中开始了一个小游戏。我的问题是这个错误:
coffee -c -o lib/ src/
/src/interface.coffee:8:48: error: unexpected end of input
@ctx.clearRect 0, 0, @size[0], @size[1]
^
我已经重写了很多次,但它仍然不想编译。这是代码:
class Interface:
constructor : (id) ->
@canvas = document.getElementById "#{id}"
@ctx = @canvas.getContext "2d"
@size = [@canvas.width, @canvas.height]
clear : () ->
@ctx.clearRect 0, 0, @size[0], @size[1]
哦,有人能告诉我这个错误到底是什么意思吗?
先感谢您。