Commit ab2ad127 authored by Jordan B Mckenney's avatar Jordan B Mckenney

commit to pull from master

parent 06d1a132
......@@ -9,6 +9,12 @@ public class Walk : AbstractBehavior {
private float xScale;
private int rightInt = 0;
private int leftInt = 0;
private float rightTime = 0;
private float leftTime = 0;
// Use this for initialization
void Start() {
xScale = body.transform.localScale.x;
......@@ -19,8 +25,10 @@ public class Walk : AbstractBehavior {
Buttons left = inputButtons[0];
Buttons right = inputButtons[1];
int rightInt = 0;
int leftInt = 0;
rightInt = 0;
leftInt = 0;
//rightTime = inputButtons[0].
if (inputState.GetButtonValue(right))
rightInt = 1;
......@@ -35,7 +43,7 @@ public class Walk : AbstractBehavior {
if (collisionState.onGround)
{
body.velocity = new Vector2(speed * (rightInt + leftInt), body.velocity.y);
} else
} else if (!collisionState.onWall)
{
airSpeed = body.velocity.x;
if (inputState.GetButtonValue(right) || inputState.GetButtonValue(left))
......@@ -51,6 +59,9 @@ public class Walk : AbstractBehavior {
}
}
body.velocity = new Vector2(airSpeed, body.velocity.y);
} else
{
}
//change localScale depending on direction
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment