Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dyingIsMainstream
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gamejam-gpn15
dyingIsMainstream
Commits
3f8d4410
Commit
3f8d4410
authored
Jun 05, 2015
by
Tim Reiter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed "getting stuck in a wall" bug.
parent
a8cee5b3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
5 deletions
+13
-5
ground.prefab
Assets/Resources/Prefabs/ground.prefab
+0
-0
PlayerControl.cs
Assets/Scripts/PlayerControl.cs
+2
-2
PlayerInputMapping.cs
Assets/Scripts/PlayerInputMapping.cs
+3
-3
SlipperyPhysics.physicsMaterial2D
Assets/SlipperyPhysics.physicsMaterial2D
+0
-0
SlipperyPhysics.physicsMaterial2D.meta
Assets/SlipperyPhysics.physicsMaterial2D.meta
+8
-0
No files found.
Assets/Resources/Prefabs/ground.prefab
View file @
3f8d4410
No preview for this file type
Assets/Scripts/PlayerControl.cs
View file @
3f8d4410
...
...
@@ -90,7 +90,6 @@ public class PlayerControl : MonoBehaviour
//Update last position:
lastPos
=
transform
.
position
;
if
(
isGrounded
())
velocity
.
y
=
0
;
...
...
@@ -142,6 +141,7 @@ public class PlayerControl : MonoBehaviour
float
verticalSmoothedFactor
=
isGrounded
()
?
0
:
inAirDampingVertical
;
if
(
velocity
.
y
>
0.0f
)
velocity
.
y
=
Mathf
.
Lerp
(
velocity
.
y
,
0
,
Time
.
deltaTime
*
verticalSmoothedFactor
);
/*==========Power Ups // Bullet management ===*/
if
(
inputMapping
.
isShootPressed
())
{
...
...
@@ -162,11 +162,11 @@ public class PlayerControl : MonoBehaviour
}
//finally set the velocity:
Debug
.
Log
(
velocity
.
y
);
body2D
.
velocity
=
velocity
+
currentPushSpeed
;
//update move direction after the currentposition was updated:
moveDirection
=
(
transform
.
position
-
lastPos
).
normalized
;
}
private
bool
isGrounded
()
...
...
Assets/Scripts/PlayerInputMapping.cs
View file @
3f8d4410
...
...
@@ -82,7 +82,7 @@ public class PlayerInputMapping : MonoBehaviour {
public
bool
isJumpPressed
()
{
if
(
usesGamepad
)
return
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
A
,
gamepadIndex
);
if
(
usesGamepad
)
return
GamePad
.
GetButton
(
GamePad
.
Button
.
A
,
gamepadIndex
);
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Jump
]);
}
...
...
@@ -113,7 +113,7 @@ public class PlayerInputMapping : MonoBehaviour {
if
(
usesGamepad
)
{
return
(
GamePad
.
GetTrigger
(
GamePad
.
Trigger
.
LeftTrigger
,
gamepadIndex
)
>
0.01f
)
||
(
GamePad
.
GetTrigger
(
GamePad
.
Trigger
.
RightTrigger
,
gamepadIndex
)
>
0.01f
)
||
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
LeftShoulder
,
gamepadIndex
)
||
GamePad
.
GetButtonDow
n
(
GamePad
.
Button
.
RightShoulder
,
gamepadIndex
);
||
GamePad
.
GetButton
(
GamePad
.
Button
.
LeftShoulder
,
gamepadIndex
)
||
GamePad
.
GetButto
n
(
GamePad
.
Button
.
RightShoulder
,
gamepadIndex
);
}
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Dash
]);
}
...
...
@@ -122,7 +122,7 @@ public class PlayerInputMapping : MonoBehaviour {
{
if
(
usesGamepad
)
{
return
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
X
,
gamepadIndex
)
||
GamePad
.
GetButtonDow
n
(
GamePad
.
Button
.
Y
,
gamepadIndex
);
return
GamePad
.
GetButton
(
GamePad
.
Button
.
X
,
gamepadIndex
)
||
GamePad
.
GetButto
n
(
GamePad
.
Button
.
Y
,
gamepadIndex
);
}
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Shoot
]);
}
...
...
Assets/SlipperyPhysics.physicsMaterial2D
0 → 100644
View file @
3f8d4410
File added
Assets/SlipperyPhysics.physicsMaterial2D.meta
0 → 100644
View file @
3f8d4410
fileFormatVersion: 2
guid: b47b2bdb189943443b6c59dafedfd2cc
timeCreated: 1433521500
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
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