灰烬方向不起作用

时间:2018-02-11 21:50:17

标签: javascript ember.js

我有一个功能

movePacMan: function (direction, amount) {
    this.incrementProperty(direction, amount);
    this.clearScreen();
    this.drawCircle();
},

但是当我需要使用它时,它不起作用

keyboardShortcuts: {
    up: function() {this.movePacMan('y', -1 * this.get('sizeSquare'));},
//doesn't work
    down: function() {this.movePacMan('y', this.get('sizeSquare'));},
//works
    left: function() {this.movePacMan('x', -1 * this.get('sizeSquare'));},
//doesn't work
    right: function() {this.movePacMan('x', this.get('sizeSquare'));},
//works
},

任何人都可以帮我解决这个问题吗?我不知道如何正确修复它

P.S。:新来的灰烬,对不起

1 个答案:

答案 0 :(得分:0)

我在sizeSqure中发现错误,谢谢!