fix achievement popup and gravity change bug

This commit is contained in:
RandomityGuy 2023-07-23 19:23:35 +05:30
parent 773efdd8dd
commit 60693cf306
2 changed files with 8 additions and 3 deletions

View file

@ -1417,6 +1417,11 @@ class MarbleWorld extends Scheduler {
this.finishPitch = this.marble.camera.CameraPitch;
displayAlert("Congratulations! You've finished!");
if (!this.isWatching) {
var myScore = {
name: "Player",
time: this.gameMode.getFinishScore()
};
Settings.saveScore(mission.path, myScore, this.gameMode.getScoreType());
var notifies = AchievementsGui.check();
var delay = 5.0;
var achDelay = 0.0;
@ -1576,7 +1581,7 @@ class MarbleWorld extends Scheduler {
var u = v1.normalized();
var v = v2.normalized();
if (u.dot(v) == -1) {
if (Math.abs(u.dot(v) + 1) < hxd.Math.EPSILON) {
var q = new Quat();
var o = orthogonal(u).normalized();
q.x = o.x;

View file

@ -123,8 +123,8 @@ class EndGameGui extends GuiImage {
var rating = calcRating(score * 1000, mission.qualifyTime * 1000, mission.goldTime * 1000, Std.parseInt(mission.missionInfo.difficulty));
var myScore = {name: "Player", time: score};
Settings.saveScore(mission.path, myScore, scoreType);
// var myScore = {name: "Player", time: score};
// Settings.saveScore(mission.path, myScore, scoreType);
var scoreData:Array<Score> = Settings.getScores(mission.path);
while (scoreData.length < 1) {