player now walks again, still stick to wall if key is kept down, but gravity is no longer accumulated (because the walking velocity is now separated)

Former-commit-id: f9394abe6230a4e60f2f7a42e81f7e85264a60c5
Former-commit-id: 1cd5b78c5800aef082d5eeec13a0a0a50ccea35b
This commit is contained in:
Song Minjae
2016-05-08 01:29:52 +09:00
parent 12876a5ce2
commit 127e6344cf
5 changed files with 94 additions and 65 deletions

View File

@@ -542,12 +542,18 @@ class Vector2 {
*/
operator fun not() = negate()
/**
* Negates this [Vector2].
* @return [Vector2] this vector
*/
operator fun unaryMinus() = negate()
/**
* Negates this [Vector2].
* @return [Vector2] this vector
*/
fun negate(): Vector2 {
return Vector2(x * -1.0, y * -1.0)
return Vector2(-x, -y)
}
/**