game.var.featherLocalPos = new THREE.Vector3();
game.var.featherBorderForce = new THREE.Vector3();
game.var.pinwheelDistance = new THREE.Vector3();
+ game.var.pinwheelRotationSpeed = 0;
game.var.notCollectedPos = new THREE.Vector3();
game.var.collectedPos = new THREE.Vector3();
game.var.endingEntryTrajectory = new THREE.Vector3();
game.controls.accelY = Math.min(0.0, game.controls.accelY);
}
- game.objects.pinwheel.rotation.z -= 5 * delta;
- game.objects.pinwheel.position.x = game.view.camera.position.x + game.controls.positionX;
- game.objects.pinwheel.position.y = game.view.camera.position.y + game.controls.positionY;
-
if(game.ui.currentPage != 'gameplay') {
let cameraSwayFactor = 1;
if(game.settings['graphics'] == 3) {
const tiltedGravity = game.gravity.clone();
game.var.pinwheelDistance.subVectors(game.objects.feather.position, game.objects.pinwheel.position).setZ(0);
+ const pinwheelRotationTargetSpeed = 1 + Math.max(0, 2 - game.var.pinwheelDistance.length());
+ game.var.pinwheelRotationSpeed = Math.max(1, pinwheelRotationTargetSpeed, game.var.pinwheelRotationSpeed - 2 * delta);
+ game.objects.pinwheel.rotation.z -= game.var.pinwheelRotationSpeed * 5 * delta;
+ game.objects.pinwheel.position.x = game.view.camera.position.x + game.controls.positionX;
+ game.objects.pinwheel.position.y = game.view.camera.position.y + game.controls.positionY;
+
const pinwheelForce = 0.5 * Math.max(0, Math.pow(game.var.pinwheelDistance.length(), - 0.5) - 0.5);
game['fn'].applyForceToFeather(game.var.pinwheelDistance.normalize().multiplyScalar(pinwheelForce));
if(pinwheelForce < 0.2) {