mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
minor ui fixes
This commit is contained in:
parent
f3e8508257
commit
b502a7bd99
6 changed files with 27 additions and 10 deletions
|
|
@ -389,8 +389,8 @@ class CameraController extends Object {
|
|||
var rightVec = camera.up.cross(forwardVec).normalized();
|
||||
var upVec = forwardVec.cross(rightVec);
|
||||
|
||||
camera.target = marblePosition.add(upVec.multiply(0.55));
|
||||
camera.up = upVec;
|
||||
camera.target = marblePosition.add(cameraVerticalTranslation);
|
||||
// camera.up = upVec;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ class MarbleWorld extends Scheduler {
|
|||
public var totalGems:Int = 0;
|
||||
public var gemCount:Int = 0;
|
||||
public var blastAmount:Float = 0;
|
||||
public var skipStartBug:Bool = false;
|
||||
|
||||
var renderBlastAmount:Float = 0;
|
||||
|
||||
|
|
@ -466,6 +467,7 @@ class MarbleWorld extends Scheduler {
|
|||
this.renderBlastAmount = 0;
|
||||
this.outOfBoundsTime = null;
|
||||
this.finishTime = null;
|
||||
this.skipStartBug = false;
|
||||
|
||||
this.currentCheckpoint = null;
|
||||
this.currentCheckpointTrigger = null;
|
||||
|
|
@ -591,7 +593,7 @@ class MarbleWorld extends Scheduler {
|
|||
if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 3.5)) {
|
||||
this.marble.setMode(Start);
|
||||
}
|
||||
if (this.timeState.currentAttemptTime >= 3.5 && this.finishTime == null) {
|
||||
if ((this.timeState.currentAttemptTime >= 3.5 && this.finishTime == null) || skipStartBug) {
|
||||
this.marble.setMode(Play);
|
||||
}
|
||||
}
|
||||
|
|
@ -1150,7 +1152,7 @@ class MarbleWorld extends Scheduler {
|
|||
var timeMultiplier = this.gameMode.timeMultiplier();
|
||||
|
||||
if (!this.isWatching) {
|
||||
if (this.bonusTime != 0 && this.timeState.currentAttemptTime >= 3.5) {
|
||||
if (this.bonusTime != 0 && (this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) {
|
||||
this.bonusTime -= dt;
|
||||
if (this.bonusTime < 0) {
|
||||
this.timeState.gameplayClock -= this.bonusTime * timeMultiplier;
|
||||
|
|
@ -1165,7 +1167,7 @@ class MarbleWorld extends Scheduler {
|
|||
timeTravelSound.stop();
|
||||
timeTravelSound = null;
|
||||
}
|
||||
if (this.timeState.currentAttemptTime >= 3.5) {
|
||||
if ((this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) {
|
||||
this.timeState.gameplayClock += dt * timeMultiplier;
|
||||
} else if (this.timeState.currentAttemptTime + dt >= 3.5) {
|
||||
this.timeState.gameplayClock += ((this.timeState.currentAttemptTime + dt) - 3.5) * timeMultiplier;
|
||||
|
|
@ -1178,7 +1180,7 @@ class MarbleWorld extends Scheduler {
|
|||
this.timeState.currentAttemptTime = this.replay.currentPlaybackFrame.time;
|
||||
this.timeState.gameplayClock = this.replay.currentPlaybackFrame.clockTime;
|
||||
this.bonusTime = this.replay.currentPlaybackFrame.bonusTime;
|
||||
if (this.bonusTime != 0 && this.timeState.currentAttemptTime >= 3.5) {
|
||||
if (this.bonusTime != 0 && (this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) {
|
||||
if (timeTravelSound == null) {
|
||||
var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources);
|
||||
timeTravelSound = AudioManager.playSound(ttsnd, null, true);
|
||||
|
|
@ -1547,9 +1549,11 @@ class MarbleWorld extends Scheduler {
|
|||
|
||||
/** Get the current interpolated orientation quaternion. */
|
||||
public function getOrientationQuat(time:Float) {
|
||||
var completion = Util.clamp((time - this.orientationChangeTime) / 0.3, 0, 1);
|
||||
var completion = Util.clamp((time - this.orientationChangeTime) / 0.8, 0, 1);
|
||||
var newDt = completion / 0.4 * 2.302585124969482;
|
||||
var smooth = 1.0 / (newDt * (newDt * 0.235 * newDt) + newDt + 1.0 + 0.48 * newDt * newDt);
|
||||
var q = this.oldOrientationQuat.clone();
|
||||
q.slerp(q, this.newOrientationQuat, completion);
|
||||
q.slerp(q, this.newOrientationQuat, 1 - smooth);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ class Radar {
|
|||
}
|
||||
g.endFill();
|
||||
g.lineStyle(1, 0x000000, arrowAlpha);
|
||||
g.setColor(0x000000, arrowAlpha);
|
||||
|
||||
if (foldArrow) {
|
||||
g.moveTo(lowerRight.x, lowerRight.y);
|
||||
|
|
@ -308,6 +309,7 @@ class Radar {
|
|||
|
||||
// Border
|
||||
g.lineStyle(1, 0x000000, circleAlpha);
|
||||
g.setColor(0x000000, circleAlpha);
|
||||
g.moveTo(midTopLeft.x, topLeft.y);
|
||||
g.lineTo(topLeft.x, midTopLeft.y);
|
||||
|
||||
|
|
@ -336,6 +338,7 @@ class Radar {
|
|||
g.endFill();
|
||||
|
||||
g.lineStyle(1, 0x000000, circleAlpha);
|
||||
g.setColor(0x000000, circleAlpha);
|
||||
|
||||
g.moveTo(halfBottomRight.x, drawPoint.y);
|
||||
g.lineTo(drawPoint.x, halfTopLeft.y);
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ class Util {
|
|||
var hundredthOne = hundredth % 10;
|
||||
var hundredthTen = (hundredth - hundredthOne) / 10;
|
||||
|
||||
return '${minutesTen}${minutesOne}:${secondsTen}${secondsOne}.${hundredthTen}${hundredthOne}${thousandth}';
|
||||
return '${minutesTen}${minutesOne}:${secondsTen}${secondsOne}.${hundredthTen}${hundredthOne}';
|
||||
}
|
||||
|
||||
public static function formatTimeHours(time:Float) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package gui;
|
||||
|
||||
import gui.GuiControl.MouseState;
|
||||
import src.AudioManager;
|
||||
import src.MarbleGame;
|
||||
import hxd.res.BitmapFont;
|
||||
|
|
@ -11,6 +12,8 @@ class ExitGameDlg extends GuiImage {
|
|||
var innerCtrl:GuiControl;
|
||||
var btnList:GuiXboxList;
|
||||
|
||||
var timeMenu:Float = 0.0;
|
||||
|
||||
public function new(yesFunc:GuiControl->Void, noFunc:GuiControl->Void, restartFunc:GuiControl->Void) {
|
||||
var res = ResourceLoader.getImage("data/ui/xbox/BG_fadeOutSoftEdge.png").resource.toTile();
|
||||
super(res);
|
||||
|
|
@ -109,4 +112,11 @@ class ExitGameDlg extends GuiImage {
|
|||
|
||||
super.onResize(width, height);
|
||||
}
|
||||
|
||||
override function update(dt:Float, mouseState:MouseState) {
|
||||
super.update(dt, mouseState);
|
||||
timeMenu += dt;
|
||||
if (timeMenu > 3)
|
||||
MarbleGame.instance.world.skipStartBug = true; // Trigger this lol
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ class PlayGui {
|
|||
blastFill.xScale = (scene2d.height - safeVerMargin * 2) / 480;
|
||||
blastFill.yScale = (scene2d.height - safeVerMargin * 2) / 480;
|
||||
var colorMat = Matrix.I();
|
||||
colorMat.colorSet(0x0080FF);
|
||||
colorMat.colorSet(0xCDD2D7);
|
||||
blastFill.bmp.filter = new h2d.filter.ColorMatrix(colorMat);
|
||||
|
||||
blastBar.addChild(blastFill);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue