pacman.js
// This function determines the direction of PacMan based on screen edge detection. 

This function determines the direction of PacMan based on screen edge detection.
This function determines the direction of PacMan based on screen edge detection .
function checkPageBounds(direction, imgWidth, pos, pageWidth) {
  if(pos > pageWidth - imgWidth) {
    direction = 1;
  }
  if(pos < 0) {
    direction = 0; 
  }
  return direction;
 }
function checkPageBounds ( direction , imgWidth , pos , pageWidth ) { if ( pos > pageWidth - imgWidth ) { direction = 1 ; } if ( pos < 0 ) { direction = 0 ; } return direction ; }
This function determines the direction of PacMan based on screen edge detection.
This function determines the direction of PacMan based on screen edge detection .