// turtle (group) - Update Every Frame
/** 
Set up vars to detect keypresses. 
**/

var rightArrowPressed = isKeyPressed(Keys.rightArrow);
var leftArrowPressed = isKeyPressed(Keys.leftArrow);

/**
if statement used to code the actual key presses
**/

if ( rightArrowPressed ) {
    moveX($this);
    
}
/** 
movement in the x direction needs to be negative to reflect moving left
**/

if ( leftArrowPressed ) {
    moveX($this, -$this.speedX());

}