Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mr BigSock
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gard Aleksander Furre
Mr BigSock
Commits
8056b083
Commit
8056b083
authored
2 years ago
by
Robin Halseth Sandvik
Browse files
Options
Downloads
Patches
Plain Diff
Character now tracks last direction it moved.
parent
0c469099
No related branches found
Branches containing commit
No related tags found
1 merge request
!53
ToolTips, new ability parameter system & misc clean ups.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MrBigsock/Assets/Code/Character.cs
+4
-0
4 additions, 0 deletions
MrBigsock/Assets/Code/Character.cs
with
4 additions
and
0 deletions
MrBigsock/Assets/Code/Character.cs
+
4
−
0
View file @
8056b083
...
...
@@ -79,6 +79,9 @@ namespace BigSock {
protected
Rigidbody2D
rb
;
// The direction the character last moved.
protected
Vector2
moveDir
;
/*
The inventory of the character.
...
...
@@ -166,6 +169,7 @@ namespace BigSock {
Try to move in a given direction.
*/
protected
virtual
bool
TryMove
(
Vector2
direction
)
{
moveDir
=
direction
;
if
(
direction
!=
Vector2
.
zero
)
{
rb
.
AddForce
(
direction
*
(
float
)
MovementSpeed
*
Time
.
fixedDeltaTime
,
ForceMode2D
.
Impulse
);
return
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment