@@ -267,9 +267,11 @@ module.exports = class AnimationsController {
267267 /**
268268 * Schedule the animations for a move from the current position
269269 * @param {number } endX X coordinate of the target position
270- * @param {number } endY Y coordinate of the target position
270+ * @param {number } endY Y coordinate of the target position
271+ * @param {string } id Optional id of pegman. If no id is provided,
272+ * will schedule move for default pegman.
271273 */
272- scheduleMove ( endX , endY , timeForAnimation , id = null ) {
274+ scheduleMove ( endX , endY , timeForAnimation , id ) {
273275 var startX = this . maze . getPegmanX ( id ) ;
274276 var startY = this . maze . getPegmanY ( id ) ;
275277 var direction = this . maze . getPegmanD ( id ) ;
@@ -336,9 +338,11 @@ module.exports = class AnimationsController {
336338
337339 /**
338340 * Schedule the animations for a turn from the current direction
339- * @param {number } endDirection The direction we're turning to
341+ * @param {number } endDirection The direction we're turning to
342+ * @param {string } id Optional id of pegman. If no id is provided,
343+ * will schedule turn for default pegman.
340344 */
341- scheduleTurn ( endDirection , id = null ) {
345+ scheduleTurn ( endDirection , id ) {
342346 var numFrames = 4 ;
343347 var startDirection = this . maze . getPegmanD ( id ) ;
344348 var deltaDirection = endDirection - startDirection ;
@@ -392,7 +396,7 @@ module.exports = class AnimationsController {
392396 }
393397 }
394398
395- scheduleWallHit ( targetX , targetY , deltaX , deltaY , frame , id = null ) {
399+ scheduleWallHit ( targetX , targetY , deltaX , deltaY , frame , id ) {
396400 // Play the animation of hitting the wall
397401 const pegmanX = this . maze . getPegmanX ( id ) ;
398402 const pegmanY = this . maze . getPegmanY ( id ) ;
@@ -463,7 +467,7 @@ module.exports = class AnimationsController {
463467 }
464468 }
465469
466- scheduleObstacleHit ( targetX , targetY , deltaX , deltaY , frame , id = null ) {
470+ scheduleObstacleHit ( targetX , targetY , deltaX , deltaY , frame , id ) {
467471 // Play the animation
468472 var obsId = targetX + this . maze . map . COLS * targetY ;
469473 var obsIcon = document . getElementById ( 'obstacle' + obsId ) ;
@@ -540,8 +544,10 @@ module.exports = class AnimationsController {
540544 * @param {boolean } victoryDance This is a victory dance after completing the
541545 * puzzle (vs. dancing on load).
542546 * @param {integer } timeAlloted How much time we have for our animations
547+ * @param {string } id Optional id of pegman. If no id is provided, will schedule
548+ * dance for default pegman.
543549 */
544- scheduleDance ( victoryDance , timeAlloted , id = null ) {
550+ scheduleDance ( victoryDance , timeAlloted , id ) {
545551 const finishIcon = document . getElementById ( 'finish' ) ;
546552 const pegmanX = this . maze . getPegmanX ( id ) ;
547553 const pegmanY = this . maze . getPegmanY ( id ) ;
@@ -644,9 +650,11 @@ module.exports = class AnimationsController {
644650 * Display Pegman at the specified location, facing the specified direction.
645651 * @param {number } x Horizontal grid (or fraction thereof).
646652 * @param {number } y Vertical grid (or fraction thereof).
647- * @param {number } frame Direction (0 - 15) or dance (16 - 17).
653+ * @param {number } frame Direction (0 - 15) or dance (16 - 17). *
654+ * @param {string } id Optional id of pegman. If no id is provided,
655+ * will display default pegman.
648656 */
649- displayPegman ( x , y , frame , id = null ) {
657+ displayPegman ( x , y , frame , id ) {
650658 var pegmanIcon = document . getElementById ( 'pegman' ) ;
651659 var clipRect = document . getElementById ( 'clipRect' ) ;
652660 displayPegman ( this . maze . skin , pegmanIcon , clipRect , x , y , frame ) ;
0 commit comments