handleInput(keyPress) {

        if (keyPress == 'left' && this.x > 0) {
            this.x -= 102;
        };

        if (keyPress == 'right' && this.x < 405) {
            this.x += 102;
        };

        if (keyPress == 'up' && this.y > 0) {
            this.y -= 83;
        };

        if (keyPress == 'down' && this.y < 405) {
            this.y += 83;
        };

        /* Once the user reaches the water area, position of
           the user is reset to the starting position */
        if (this.y < 0) {
            setTimeout(() => {
                openModal(false);
                this.x = 202;
                this.y = 405;
            }, 500);
        };
    }
/**
     * This method takes in keypress event alias key code and moves player from one position to other
     * based on the keys pressed.
     * @param keyPress
     */
This method takes in keypress event alias key code and moves player from one position to other
based on the keys pressed.
@param keyPress
This method takes in keypress event alias key code and moves player from one position to other based on the keys pressed . @param keyPress
handleInput(keyPress) {
        if (keyPress == 'left' && this.x > 0) {
            this.x -= 102;
        };
        if (keyPress == 'right' && this.x < 405) {
            this.x += 102;
        };
        if (keyPress == 'up' && this.y > 0) {
            this.y -= 83;
        };
        if (keyPress == 'down' && this.y < 405) {
            this.y += 83;
        };
        if (this.y < 0) {
            setTimeout(() => {
                openModal(false);
                this.x = 202;
                this.y = 405;
            }, 500);
        };
    }
handleInput ( keyPress ) { if ( keyPress == 'left' && this . x > 0 ) { this . x -= 102 ; } ; if ( keyPress == 'right' && this . x < 405 ) { this . x += 102 ; } ; if ( keyPress == 'up' && this . y > 0 ) { this . y -= 83 ; } ; if ( keyPress == 'down' && this . y < 405 ) { this . y += 83 ; } ; if ( this . y < 0 ) { setTimeout ( ( ) => { openModal ( false ) ; this . x = 202 ; this . y = 405 ; } , 500 ) ; } ; }
This method takes in keypress event alias key code and moves player from one position to other
 based on the keys pressed.
This method takes in keypress event alias key code and moves player from one position to other based on the keys pressed .
/* Once the user reaches the water area, position of
           the user is reset to the starting position */