Skip to content
Snippets Groups Projects
Commit d2904ff4 authored by lukasWoyke's avatar lukasWoyke
Browse files

Fixed reverse controlling.

parent 962e8a75
No related branches found
No related tags found
3 merge requests!62Fix master,!60Code cleanup lukas fix,!57Hot fix gyroscope
......@@ -105,7 +105,7 @@ class GameGyroscopeController {
/// Caclulates the vector for controlling the character, by using the input
private func calculateAccVector(newAcc: SIMD3<Double>) -> CGVector {
checkReorientation()
// checkReorientation()
// Sets the initial position, with the first reading attempt.
if resetOrientationActive {
initialZ = newAcc.z
......@@ -119,7 +119,7 @@ class GameGyroscopeController {
var dy = newAcc.x - initialX
// Adjust movement when user olds device in LandscapeRight orientation.
if newAcc.x > 0 {
if UIDevice.current.orientation == .landscapeLeft {
dx *= (-1)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment