engine/actions.js
/*
      Before we make the move, we need to notify the field where we want to go.
      NOTE: be sure to bind its context to this move action
     */
Before we make the move, we need to notify the field where we want to go.
NOTE: be sure to bind its context to this move action
Before we make the move we need to notify the field where we want to go . NOTE : be sure to bind its context to this move action
_preTick(tick) {
        if (this._moveFailedAt != undefined) return;
        let field = this.entity.cell.field;
        let fromCell = this.entity.cell;
        this._toCell = field.getNeighbour(fromCell, this.direction);
        if (this._toCell != Cell.OutOfBounds) {
            this._toCell.futureOccupants.push(this.entity);
        }
    }
_preTick ( tick ) { if ( this . _moveFailedAt != undefined ) return ; let field = this . entity . cell . field ; let fromCell = this . entity . cell ; this . _toCell = field . getNeighbour ( fromCell , this . direction ) ; if ( this . _toCell != Cell . OutOfBounds ) { this . _toCell . futureOccupants . push ( this . entity ) ; } }
Before we make the move, we need to notify the field where we want to go.
Before we make the move we need to notify the field where we want to go .
// bail out if the move already failed