fix achievement popup and gravity change bug

This commit is contained in:
RandomityGuy 2023-07-23 19:23:35 +05:30
parent 0bfed0ffa0
commit 5b0f1073cb
2 changed files with 8 additions and 3 deletions

View file

@ -1418,6 +1418,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;
@ -1577,7 +1582,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

@ -118,8 +118,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) {