fix marble and endgame bugs

This commit is contained in:
RandomityGuy 2023-02-20 17:31:21 +05:30
parent fd837715de
commit 95fcefc2d9
3 changed files with 18 additions and 10 deletions

View file

@ -197,14 +197,6 @@ class Marble extends GameObject {
public function new() { public function new() {
super(); super();
var geom = Sphere.defaultUnitSphere();
geom.addUVs();
var marbleTexture = ResourceLoader.getFileEntry("data/shapes/balls/base.marble.png").toTexture();
var marbleMaterial = Material.create(marbleTexture);
marbleMaterial.shadows = false;
marbleMaterial.castShadows = true;
var obj = new Mesh(geom, marbleMaterial, this);
obj.scale(_radius);
this.velocity = new Vector(); this.velocity = new Vector();
this.omega = new Vector(); this.omega = new Vector();
@ -239,6 +231,19 @@ class Marble extends GameObject {
public function init(level:MarbleWorld, onFinish:Void->Void) { public function init(level:MarbleWorld, onFinish:Void->Void) {
this.level = level; this.level = level;
var marbleDts = new DtsObject();
marbleDts.dtsPath = 'data/shapes/balls/ball-superball.dts';
marbleDts.showSequences = false;
marbleDts.useInstancing = false;
marbleDts.init(null, () -> {}); // SYNC
for (mat in marbleDts.materials) {
mat.castShadows = true;
mat.shadows = true;
mat.receiveShadows = false;
}
this.addChild(marbleDts);
this.forcefield = new DtsObject(); this.forcefield = new DtsObject();
this.forcefield.dtsPath = "data/shapes/images/glow_bounce.dts"; this.forcefield.dtsPath = "data/shapes/images/glow_bounce.dts";
this.forcefield.useInstancing = true; this.forcefield.useInstancing = true;

View file

@ -320,6 +320,7 @@ class MarbleWorld extends Scheduler {
"shapes/pads/green.jpg", "shapes/pads/green.jpg",
"shapes/items/gem.dts", // Ew ew "shapes/items/gem.dts", // Ew ew
"shapes/items/gemshine.png", "shapes/items/gemshine.png",
"shapes/balls/base.marble.png"
]; ];
for (file in marblefiles) { for (file in marblefiles) {
worker.loadFile(file); worker.loadFile(file);

View file

@ -174,8 +174,10 @@ class EndGameGui extends GuiControl {
var idx = scoreTimes.indexOf(timeState.gameplayClock); var idx = scoreTimes.indexOf(timeState.gameplayClock);
if (Settings.progression[mission.difficultyIndex] == mission.index && qualified) { if (mission.type != "custom") {
Settings.progression[mission.difficultyIndex]++; if (Settings.progression[mission.difficultyIndex] == mission.index && qualified) {
Settings.progression[mission.difficultyIndex]++;
}
} }
Settings.save(); Settings.save();