private void GameStart() { blueberries = 3; print("Blueberries: " + blueberries); transform.localPosition = startPosition; rigidbody2D.isKinematic = false; isActive = true; enabled = true; salAnimation = salAnim.Idle; facingDirection = facingDir.right; theDirectionBtn = directionBtn.none; }
void UpdateFacingDirection() { if (horizontalInput < 0 || horizontalInput > 0) { salAnimation = salAnim.Walk; salAnimator.Play("Walk"); } // keyboard input if (horizontalInput < 0) { if (facingDirection != facingDir.left) { if (theDirectionBtn != directionBtn.isLeft) { //flipX = -1; FlipX(); theDirectionBtn = directionBtn.isLeft; facingDirection = facingDir.left; } } } else if (horizontalInput > 0) { if (facingDirection != facingDir.right) { if (theDirectionBtn != directionBtn.isRight) { //flipX = Mathf.Abs(flipX); FlipX(); theDirectionBtn = directionBtn.isRight; facingDirection = facingDir.right; } } } else { theDirectionBtn = directionBtn.none; } //print ("DirectionBtn being pressed: " + theDirectionBtn); //print ("Facing: " + facingDirection); }
// Use this for initialization void Start() { speed = 0.05f; maxSpeed = 1.0f; //not in use currentDir = facingDir.right; }
void UpdateFacingDirection() { if (horizontalInput < 0 || horizontalInput > 0) { salAnimation = salAnim.Walk; salAnimator.Play("Walk"); } // keyboard input if(horizontalInput < 0) { if(facingDirection != facingDir.left) { if(theDirectionBtn != directionBtn.isLeft) { //flipX = -1; FlipX(); theDirectionBtn = directionBtn.isLeft; facingDirection = facingDir.left; } } } else if (horizontalInput > 0) { if(facingDirection != facingDir.right) { if(theDirectionBtn != directionBtn.isRight) { //flipX = Mathf.Abs(flipX); FlipX(); theDirectionBtn = directionBtn.isRight; facingDirection = facingDir.right; } } } else { theDirectionBtn = directionBtn.none; } //print ("DirectionBtn being pressed: " + theDirectionBtn); //print ("Facing: " + facingDirection); }
private void GameStart() { blueberries = 3; print ("Blueberries: " + blueberries); transform.localPosition = startPosition; rigidbody2D.isKinematic = false; isActive = true; enabled = true; salAnimation = salAnim.Idle; facingDirection = facingDir.right; theDirectionBtn = directionBtn.none; }