Added rumble on enemy hit, added try for teleport

This commit is contained in:
jancoow
2016-06-22 02:58:45 +02:00
parent c9e5be2573
commit 2230682a85
8 changed files with 42 additions and 2 deletions
+17
View File
@@ -130,6 +130,14 @@ void CrystalPoint::update()
player->hit = true;
}
if(player->isHit){
controller.rumble(leftcontroller->controllerId, 50, 250);
}
if(!leftcontroller->lastMagetSwitch && leftcontroller->magnetSwitch){
worldhandler -> teleportRandom();
}
}
if(rightcontroller != nullptr){
Vec2f *rightControllerJoystick = &rightcontroller->joystick;
@@ -153,6 +161,15 @@ void CrystalPoint::update()
player->NextRightWeapon();
}
if(player->isHit){
controller.rumble(rightcontroller->controllerId, 50, 250);
player->isHit = false;
}
if(!rightcontroller->lastMagetSwitch && rightcontroller->magnetSwitch){
worldhandler -> teleportRandom();
}
player->rightWeapon->rotateWeapon(Vec3f(rightcontroller->ypr.y + 140, 0, -rightcontroller->ypr.z));
}