Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Birb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gadig
Birb
Commits
06d1a132
Commit
06d1a132
authored
Feb 23, 2017
by
Jordan B Mckenney
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'walk' of git.gmu.edu:gadig/Birb into walk
parents
1a6a7e32
a08f69c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
Assets/Scripts/Player/Walk.cs
Assets/Scripts/Player/Walk.cs
+17
-1
No files found.
Assets/Scripts/Player/Walk.cs
View file @
06d1a132
...
...
@@ -7,9 +7,11 @@ public class Walk : AbstractBehavior {
private
float
airSpeed
;
public
float
airAcceleration
;
private
float
xScale
;
// Use this for initialization
void
Start
()
{
xScale
=
body
.
transform
.
localScale
.
x
;
}
// Update is called once per frame
...
...
@@ -50,5 +52,19 @@ public class Walk : AbstractBehavior {
}
body
.
velocity
=
new
Vector2
(
airSpeed
,
body
.
velocity
.
y
);
}
//change localScale depending on direction
if
(
inputState
.
GetButtonValue
(
right
)
&&
inputState
.
GetButtonValue
(
left
))
{
}
else
if
(
inputState
.
GetButtonValue
(
right
))
{
inputState
.
direction
=
Directions
.
Right
;
body
.
transform
.
localScale
=
new
Vector3
(
xScale
,
body
.
transform
.
localScale
.
y
,
body
.
transform
.
localScale
.
z
);
}
else
if
(
inputState
.
GetButtonValue
(
left
))
{
inputState
.
direction
=
Directions
.
Left
;
body
.
transform
.
localScale
=
new
Vector3
(-
xScale
,
body
.
transform
.
localScale
.
y
,
body
.
transform
.
localScale
.
z
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment