mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix some bugs and clean up stuff
This commit is contained in:
parent
d12b98e0f3
commit
13ab96f7b6
9 changed files with 65 additions and 41 deletions
|
|
@ -80,8 +80,6 @@ class MarbleWorldMacros {
|
||||||
shape = new EasterEgg(cast element);
|
shape = new EasterEgg(cast element);
|
||||||
else if (dataBlockLowerCase == "checkpointshape") {
|
else if (dataBlockLowerCase == "checkpointshape") {
|
||||||
shape = new Checkpoint(cast element);
|
shape = new Checkpoint(cast element);
|
||||||
if (_previousCheckpointTrigger != null)
|
|
||||||
_previousCheckpointTrigger.checkpoint = cast shape;
|
|
||||||
} else if (dataBlockLowerCase == "ductfan")
|
} else if (dataBlockLowerCase == "ductfan")
|
||||||
shape = new DuctFan();
|
shape = new DuctFan();
|
||||||
else if (dataBlockLowerCase == "smallductfan")
|
else if (dataBlockLowerCase == "smallductfan")
|
||||||
|
|
@ -152,6 +150,7 @@ class MarbleWorldMacros {
|
||||||
mat.setPosition(shapePosition);
|
mat.setPosition(shapePosition);
|
||||||
|
|
||||||
this.addDtsObject(shape, () -> {
|
this.addDtsObject(shape, () -> {
|
||||||
|
addToSimgroup(shape, simGroup);
|
||||||
shape.setTransform(mat);
|
shape.setTransform(mat);
|
||||||
onFinish();
|
onFinish();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1945,6 +1945,7 @@ class Marble extends GameObject {
|
||||||
this.helicopter.setPosition(x, y, z);
|
this.helicopter.setPosition(x, y, z);
|
||||||
this.helicopter.setRotationQuat(this.level.getOrientationQuat(currentTime));
|
this.helicopter.setRotationQuat(this.level.getOrientationQuat(currentTime));
|
||||||
this.helicopterSound.pause = false;
|
this.helicopterSound.pause = false;
|
||||||
|
this.helicopter.setScale(this._renderScale);
|
||||||
} else {
|
} else {
|
||||||
this.helicopter.setPosition(1e8, 1e8, 1e8);
|
this.helicopter.setPosition(1e8, 1e8, 1e8);
|
||||||
this.helicopterSound.pause = true;
|
this.helicopterSound.pause = true;
|
||||||
|
|
@ -1952,6 +1953,7 @@ class Marble extends GameObject {
|
||||||
if (currentTime - this.blastUseTime < this.blastWave.dts.sequences[0].duration) {
|
if (currentTime - this.blastUseTime < this.blastWave.dts.sequences[0].duration) {
|
||||||
this.blastWave.setPosition(x, y, z);
|
this.blastWave.setPosition(x, y, z);
|
||||||
this.blastWave.setRotationQuat(this.level.getOrientationQuat(this.level.timeState.currentAttemptTime));
|
this.blastWave.setRotationQuat(this.level.getOrientationQuat(this.level.timeState.currentAttemptTime));
|
||||||
|
this.blastWave.setScale(this._renderScale);
|
||||||
} else {
|
} else {
|
||||||
this.blastWave.setPosition(1e8, 1e8, 1e8);
|
this.blastWave.setPosition(1e8, 1e8, 1e8);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ class MarbleWorld extends Scheduler {
|
||||||
public var triggers:Array<Trigger> = [];
|
public var triggers:Array<Trigger> = [];
|
||||||
public var gems:Array<Gem> = [];
|
public var gems:Array<Gem> = [];
|
||||||
public var namedObjects:Map<String, {obj:DtsObject, elem:MissionElementBase}> = [];
|
public var namedObjects:Map<String, {obj:DtsObject, elem:MissionElementBase}> = [];
|
||||||
|
public var simGroups:Map<MissionElementSimGroup, Array<GameObject>> = [];
|
||||||
|
|
||||||
var shapeImmunity:Array<DtsObject> = [];
|
var shapeImmunity:Array<DtsObject> = [];
|
||||||
var shapeOrTriggerInside:Array<GameObject> = [];
|
var shapeOrTriggerInside:Array<GameObject> = [];
|
||||||
|
|
@ -160,10 +161,8 @@ class MarbleWorld extends Scheduler {
|
||||||
var currentCheckpointTrigger:CheckpointTrigger = null;
|
var currentCheckpointTrigger:CheckpointTrigger = null;
|
||||||
var checkpointCollectedGems:Map<Gem, Bool> = [];
|
var checkpointCollectedGems:Map<Gem, Bool> = [];
|
||||||
var checkpointHeldPowerup:PowerUp = null;
|
var checkpointHeldPowerup:PowerUp = null;
|
||||||
var checkpointUp:Vector = null;
|
|
||||||
var cheeckpointBlast:Float = 0;
|
var cheeckpointBlast:Float = 0;
|
||||||
var checkpointSequence:Int = 0;
|
var checkpointSequence:Int = 0;
|
||||||
var _previousCheckpointTrigger:CheckpointTrigger;
|
|
||||||
|
|
||||||
// Replay
|
// Replay
|
||||||
public var replay:Replay;
|
public var replay:Replay;
|
||||||
|
|
@ -389,6 +388,7 @@ class MarbleWorld extends Scheduler {
|
||||||
marblefiles.push("shapes/balls/marble20.normal.png");
|
marblefiles.push("shapes/balls/marble20.normal.png");
|
||||||
marblefiles.push("shapes/balls/marble18.normal.png");
|
marblefiles.push("shapes/balls/marble18.normal.png");
|
||||||
marblefiles.push("shapes/balls/marble01.normal.png");
|
marblefiles.push("shapes/balls/marble01.normal.png");
|
||||||
|
marblefiles.push("shapes/balls/marble02.normal.png");
|
||||||
marblefiles.push("sound/use_blast.wav");
|
marblefiles.push("sound/use_blast.wav");
|
||||||
}
|
}
|
||||||
// Hacky
|
// Hacky
|
||||||
|
|
@ -444,7 +444,6 @@ class MarbleWorld extends Scheduler {
|
||||||
this.currentCheckpointTrigger = null;
|
this.currentCheckpointTrigger = null;
|
||||||
this.checkpointCollectedGems.clear();
|
this.checkpointCollectedGems.clear();
|
||||||
this.checkpointHeldPowerup = null;
|
this.checkpointHeldPowerup = null;
|
||||||
this.checkpointUp = null;
|
|
||||||
this.cheeckpointBlast = 0;
|
this.cheeckpointBlast = 0;
|
||||||
this.checkpointSequence = 0;
|
this.checkpointSequence = 0;
|
||||||
|
|
||||||
|
|
@ -552,6 +551,15 @@ class MarbleWorld extends Scheduler {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addToSimgroup(obj:GameObject, simGroup:MissionElementSimGroup) {
|
||||||
|
if (simGroup == null)
|
||||||
|
return;
|
||||||
|
if (!simGroups.exists(simGroup))
|
||||||
|
simGroups[simGroup] = [obj];
|
||||||
|
else
|
||||||
|
simGroups[simGroup].push(obj);
|
||||||
|
}
|
||||||
|
|
||||||
public function addSimGroup(simGroup:MissionElementSimGroup) {
|
public function addSimGroup(simGroup:MissionElementSimGroup) {
|
||||||
if (simGroup.elements.filter((element) -> element._type == MissionElementType.PathedInterior).length != 0) {
|
if (simGroup.elements.filter((element) -> element._type == MissionElementType.PathedInterior).length != 0) {
|
||||||
// Create the pathed interior
|
// Create the pathed interior
|
||||||
|
|
@ -583,15 +591,15 @@ class MarbleWorld extends Scheduler {
|
||||||
case MissionElementType.SimGroup:
|
case MissionElementType.SimGroup:
|
||||||
this.addSimGroup(cast element);
|
this.addSimGroup(cast element);
|
||||||
case MissionElementType.InteriorInstance:
|
case MissionElementType.InteriorInstance:
|
||||||
resourceLoadFuncs.push(fwd -> this.addInteriorFromMis(cast element, fwd));
|
resourceLoadFuncs.push(fwd -> this.addInteriorFromMis(cast element, simGroup, fwd));
|
||||||
case MissionElementType.StaticShape:
|
case MissionElementType.StaticShape:
|
||||||
resourceLoadFuncs.push(fwd -> this.addStaticShape(cast element, fwd));
|
resourceLoadFuncs.push(fwd -> this.addStaticShape(cast element, simGroup, fwd));
|
||||||
case MissionElementType.Item:
|
case MissionElementType.Item:
|
||||||
resourceLoadFuncs.push(fwd -> this.addItem(cast element, fwd));
|
resourceLoadFuncs.push(fwd -> this.addItem(cast element, simGroup, fwd));
|
||||||
case MissionElementType.Trigger:
|
case MissionElementType.Trigger:
|
||||||
resourceLoadFuncs.push(fwd -> this.addTrigger(cast element, fwd));
|
resourceLoadFuncs.push(fwd -> this.addTrigger(cast element, simGroup, fwd));
|
||||||
case MissionElementType.TSStatic:
|
case MissionElementType.TSStatic:
|
||||||
resourceLoadFuncs.push(fwd -> this.addTSStatic(cast element, fwd));
|
resourceLoadFuncs.push(fwd -> this.addTSStatic(cast element, simGroup, fwd));
|
||||||
case MissionElementType.ParticleEmitterNode:
|
case MissionElementType.ParticleEmitterNode:
|
||||||
resourceLoadFuncs.push(fwd -> {
|
resourceLoadFuncs.push(fwd -> {
|
||||||
this.addParticleEmitterNode(cast element);
|
this.addParticleEmitterNode(cast element);
|
||||||
|
|
@ -602,7 +610,7 @@ class MarbleWorld extends Scheduler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addInteriorFromMis(element:MissionElementInteriorInstance, onFinish:Void->Void) {
|
public function addInteriorFromMis(element:MissionElementInteriorInstance, simGroup:MissionElementSimGroup, onFinish:Void->Void) {
|
||||||
var difPath = this.mission.getDifPath(element.interiorfile);
|
var difPath = this.mission.getDifPath(element.interiorfile);
|
||||||
if (difPath == "") {
|
if (difPath == "") {
|
||||||
onFinish();
|
onFinish();
|
||||||
|
|
@ -614,6 +622,8 @@ class MarbleWorld extends Scheduler {
|
||||||
// DifBuilder.loadDif(difPath, interior);
|
// DifBuilder.loadDif(difPath, interior);
|
||||||
// this.interiors.push(interior);
|
// this.interiors.push(interior);
|
||||||
this.addInterior(interior, () -> {
|
this.addInterior(interior, () -> {
|
||||||
|
addToSimgroup(interior, simGroup);
|
||||||
|
|
||||||
var interiorPosition = MisParser.parseVector3(element.position);
|
var interiorPosition = MisParser.parseVector3(element.position);
|
||||||
interiorPosition.x = -interiorPosition.x;
|
interiorPosition.x = -interiorPosition.x;
|
||||||
var interiorRotation = MisParser.parseRotation(element.rotation);
|
var interiorRotation = MisParser.parseRotation(element.rotation);
|
||||||
|
|
@ -649,17 +659,17 @@ class MarbleWorld extends Scheduler {
|
||||||
// this.physics.addInterior(interior);
|
// this.physics.addInterior(interior);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addStaticShape(element:MissionElementStaticShape, onFinish:Void->Void) {
|
public function addStaticShape(element:MissionElementStaticShape, simGroup:MissionElementSimGroup, onFinish:Void->Void) {
|
||||||
var shape:DtsObject = null;
|
var shape:DtsObject = null;
|
||||||
MarbleWorldMacros.addStaticShapeOrItem();
|
MarbleWorldMacros.addStaticShapeOrItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addItem(element:MissionElementItem, onFinish:Void->Void) {
|
public function addItem(element:MissionElementItem, simGroup:MissionElementSimGroup, onFinish:Void->Void) {
|
||||||
var shape:DtsObject = null;
|
var shape:DtsObject = null;
|
||||||
MarbleWorldMacros.addStaticShapeOrItem();
|
MarbleWorldMacros.addStaticShapeOrItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addTrigger(element:MissionElementTrigger, onFinish:Void->Void) {
|
public function addTrigger(element:MissionElementTrigger, simGroup:MissionElementSimGroup, onFinish:Void->Void) {
|
||||||
var trigger:Trigger = null;
|
var trigger:Trigger = null;
|
||||||
|
|
||||||
var datablockLowercase = element.datablock.toLowerCase();
|
var datablockLowercase = element.datablock.toLowerCase();
|
||||||
|
|
@ -672,8 +682,9 @@ class MarbleWorld extends Scheduler {
|
||||||
} else if (datablockLowercase == "helptrigger") {
|
} else if (datablockLowercase == "helptrigger") {
|
||||||
trigger = new HelpTrigger(element, cast this);
|
trigger = new HelpTrigger(element, cast this);
|
||||||
} else if (datablockLowercase == "checkpointtrigger") {
|
} else if (datablockLowercase == "checkpointtrigger") {
|
||||||
trigger = new CheckpointTrigger(element, cast this);
|
var chk = new CheckpointTrigger(element, cast this);
|
||||||
_previousCheckpointTrigger = cast trigger;
|
trigger = chk;
|
||||||
|
chk.simGroup = simGroup;
|
||||||
} else {
|
} else {
|
||||||
Console.error("Unknown trigger: " + element.datablock);
|
Console.error("Unknown trigger: " + element.datablock);
|
||||||
onFinish();
|
onFinish();
|
||||||
|
|
@ -682,12 +693,13 @@ class MarbleWorld extends Scheduler {
|
||||||
|
|
||||||
trigger.init(() -> {
|
trigger.init(() -> {
|
||||||
this.triggers.push(trigger);
|
this.triggers.push(trigger);
|
||||||
|
addToSimgroup(trigger, simGroup);
|
||||||
this.collisionWorld.addEntity(trigger.collider);
|
this.collisionWorld.addEntity(trigger.collider);
|
||||||
onFinish();
|
onFinish();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addTSStatic(element:MissionElementTSStatic, onFinish:Void->Void) {
|
public function addTSStatic(element:MissionElementTSStatic, simGroup:MissionElementSimGroup, onFinish:Void->Void) {
|
||||||
// !! WARNING - UNTESTED !!
|
// !! WARNING - UNTESTED !!
|
||||||
var shapeName = element.shapename;
|
var shapeName = element.shapename;
|
||||||
var index = shapeName.indexOf('data/');
|
var index = shapeName.indexOf('data/');
|
||||||
|
|
@ -740,6 +752,7 @@ class MarbleWorld extends Scheduler {
|
||||||
mat.setPosition(shapePosition);
|
mat.setPosition(shapePosition);
|
||||||
|
|
||||||
this.addDtsObject(tsShape, () -> {
|
this.addDtsObject(tsShape, () -> {
|
||||||
|
addToSimgroup(tsShape, simGroup);
|
||||||
tsShape.setTransform(mat);
|
tsShape.setTransform(mat);
|
||||||
onFinish();
|
onFinish();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
@ -1606,7 +1619,6 @@ class MarbleWorld extends Scheduler {
|
||||||
this.currentCheckpoint = shape;
|
this.currentCheckpoint = shape;
|
||||||
this.currentCheckpointTrigger = trigger;
|
this.currentCheckpointTrigger = trigger;
|
||||||
this.checkpointCollectedGems.clear();
|
this.checkpointCollectedGems.clear();
|
||||||
this.checkpointUp = this.currentUp.clone();
|
|
||||||
this.cheeckpointBlast = this.blastAmount;
|
this.cheeckpointBlast = this.blastAmount;
|
||||||
// Remember all gems that were collected up to this point
|
// Remember all gems that were collected up to this point
|
||||||
for (gem in this.gems) {
|
for (gem in this.gems) {
|
||||||
|
|
@ -1624,6 +1636,7 @@ class MarbleWorld extends Scheduler {
|
||||||
var marble = this.marble;
|
var marble = this.marble;
|
||||||
// Determine where to spawn the marble
|
// Determine where to spawn the marble
|
||||||
var offset = new Vector(0, 0, 0.727843);
|
var offset = new Vector(0, 0, 0.727843);
|
||||||
|
offset.transform(this.currentCheckpoint.getRotationQuat().toMatrix());
|
||||||
var mpos = this.currentCheckpoint.getAbsPos().getPosition().add(offset);
|
var mpos = this.currentCheckpoint.getAbsPos().getPosition().add(offset);
|
||||||
this.marble.setMarblePosition(mpos.x, mpos.y, mpos.z);
|
this.marble.setMarblePosition(mpos.x, mpos.y, mpos.z);
|
||||||
marble.velocity.load(new Vector(0, 0, 0));
|
marble.velocity.load(new Vector(0, 0, 0));
|
||||||
|
|
@ -1654,15 +1667,12 @@ class MarbleWorld extends Scheduler {
|
||||||
gravityField = @:privateAccess this.currentCheckpointTrigger.element.fields.get('gravity')[0];
|
gravityField = @:privateAccess this.currentCheckpointTrigger.element.fields.get('gravity')[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MisParser.parseBoolean(gravityField)) {
|
|
||||||
// In this case, we set the gravity to the relative "up" vector of the checkpoint shape.
|
// In this case, we set the gravity to the relative "up" vector of the checkpoint shape.
|
||||||
var up = new Vector(0, 0, 1);
|
var up = new Vector(0, 0, 1);
|
||||||
up.transform(this.currentCheckpoint.getRotationQuat().toMatrix());
|
up.transform(this.currentCheckpoint.getRotationQuat().toMatrix());
|
||||||
this.setUp(up, this.timeState, true);
|
this.setUp(up, this.timeState, true);
|
||||||
} else {
|
|
||||||
// Otherwise, we restore gravity to what was stored.
|
|
||||||
this.setUp(this.checkpointUp, this.timeState, true);
|
|
||||||
}
|
|
||||||
// Restore gem states
|
// Restore gem states
|
||||||
for (gem in this.gems) {
|
for (gem in this.gems) {
|
||||||
if (gem.pickedUp && !this.checkpointCollectedGems.exists(gem)) {
|
if (gem.pickedUp && !this.checkpointCollectedGems.exists(gem)) {
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,7 @@ class PreviewWorld extends Scheduler {
|
||||||
|
|
||||||
scene.camera.setFovX(90, Settings.optionsSettings.screenWidth / Settings.optionsSettings.screenHeight);
|
scene.camera.setFovX(90, Settings.optionsSettings.screenWidth / Settings.optionsSettings.screenHeight);
|
||||||
|
|
||||||
|
scene.camera.up.set(0, 0, 1);
|
||||||
scene.camera.pos.load(camPos.add(off));
|
scene.camera.pos.load(camPos.add(off));
|
||||||
scene.camera.target.load(scene.camera.pos.add(directionVector));
|
scene.camera.target.load(scene.camera.pos.add(directionVector));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -223,8 +223,16 @@ class MarblePickerGui extends GuiImage {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
var res = ResourceLoader.getImage("data/ui/xbox/BG_fadeOutSoftEdge.png").resource.toTile();
|
var res = ResourceLoader.getImage("data/ui/game/CloudBG.jpg").resource.toTile();
|
||||||
super(res);
|
super(res);
|
||||||
|
|
||||||
|
var fadeEdge = new GuiImage(ResourceLoader.getResource("data/ui/xbox/BG_fadeOutSoftEdge.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
|
fadeEdge.position = new Vector(0, 0);
|
||||||
|
fadeEdge.extent = new Vector(640, 480);
|
||||||
|
fadeEdge.vertSizing = Height;
|
||||||
|
fadeEdge.horizSizing = Width;
|
||||||
|
this.addChild(fadeEdge);
|
||||||
|
|
||||||
var domcasual32fontdata = ResourceLoader.getFileEntry("data/font/DomCasualD.fnt");
|
var domcasual32fontdata = ResourceLoader.getFileEntry("data/font/DomCasualD.fnt");
|
||||||
var domcasual32b = new BitmapFont(domcasual32fontdata.entry);
|
var domcasual32b = new BitmapFont(domcasual32fontdata.entry);
|
||||||
@:privateAccess domcasual32b.loader = ResourceLoader.loader;
|
@:privateAccess domcasual32b.loader = ResourceLoader.loader;
|
||||||
|
|
@ -267,6 +275,7 @@ class MarblePickerGui extends GuiImage {
|
||||||
var prevPreview = @:privateAccess MarbleGame.instance.previewWorld.currentMission;
|
var prevPreview = @:privateAccess MarbleGame.instance.previewWorld.currentMission;
|
||||||
|
|
||||||
MarbleGame.instance.setPreviewMission("marblepicker", () -> {
|
MarbleGame.instance.setPreviewMission("marblepicker", () -> {
|
||||||
|
this.bmp.visible = false;
|
||||||
@:privateAccess MarbleGame.instance.previewWorld.spawnMarble(marb -> {
|
@:privateAccess MarbleGame.instance.previewWorld.spawnMarble(marb -> {
|
||||||
var spawnPos = @:privateAccess MarbleGame.instance.scene.camera.pos.add(new Vector(0, 1, 1));
|
var spawnPos = @:privateAccess MarbleGame.instance.scene.camera.pos.add(new Vector(0, 1, 1));
|
||||||
var velAdd = new Vector((1 - 2 * Math.random()) * 2, (1 - 2 * Math.random()) * 1.5, (1 - 2 * Math.random()) * 1);
|
var velAdd = new Vector((1 - 2 * Math.random()) * 2, (1 - 2 * Math.random()) * 1.5, (1 - 2 * Math.random()) * 1);
|
||||||
|
|
@ -319,8 +328,10 @@ class MarblePickerGui extends GuiImage {
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["OK"];
|
backButton.gamepadAccelerator = ["OK"];
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
MarbleGame.canvas.setContent(new OptionsListGui());
|
this.bmp.visible = true;
|
||||||
MarbleGame.instance.setPreviewMission(prevPreview, () -> {}, false);
|
MarbleGame.instance.setPreviewMission(prevPreview, () -> {
|
||||||
|
MarbleGame.canvas.setContent(new OptionsListGui());
|
||||||
|
}, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
bottomBar.addChild(backButton);
|
bottomBar.addChild(backButton);
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ class RewindFrame {
|
||||||
currentCheckpointTrigger:CheckpointTrigger,
|
currentCheckpointTrigger:CheckpointTrigger,
|
||||||
checkpointCollectedGems:Map<Gem, Bool>,
|
checkpointCollectedGems:Map<Gem, Bool>,
|
||||||
checkpointHeldPowerup:PowerUp,
|
checkpointHeldPowerup:PowerUp,
|
||||||
checkpointUp:Vector,
|
|
||||||
checkpointBlast:Float
|
checkpointBlast:Float
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -95,7 +94,6 @@ class RewindFrame {
|
||||||
currentCheckpointTrigger: checkpointState.currentCheckpointTrigger,
|
currentCheckpointTrigger: checkpointState.currentCheckpointTrigger,
|
||||||
checkpointCollectedGems: checkpointState.checkpointCollectedGems.copy(),
|
checkpointCollectedGems: checkpointState.checkpointCollectedGems.copy(),
|
||||||
checkpointHeldPowerup: checkpointState.checkpointHeldPowerup,
|
checkpointHeldPowerup: checkpointState.checkpointHeldPowerup,
|
||||||
checkpointUp: checkpointState.checkpointUp != null ? checkpointState.checkpointUp.clone() : null,
|
|
||||||
checkpointBlast: checkpointState.checkpointBlast,
|
checkpointBlast: checkpointState.checkpointBlast,
|
||||||
};
|
};
|
||||||
return c;
|
return c;
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ class RewindManager {
|
||||||
checkpointBlast: @:privateAccess level.cheeckpointBlast,
|
checkpointBlast: @:privateAccess level.cheeckpointBlast,
|
||||||
checkpointCollectedGems: @:privateAccess level.checkpointCollectedGems.copy(),
|
checkpointCollectedGems: @:privateAccess level.checkpointCollectedGems.copy(),
|
||||||
checkpointHeldPowerup: @:privateAccess level.checkpointHeldPowerup,
|
checkpointHeldPowerup: @:privateAccess level.checkpointHeldPowerup,
|
||||||
checkpointUp: @:privateAccess level.checkpointUp != null ? @:privateAccess level.checkpointUp.clone() : null,
|
|
||||||
};
|
};
|
||||||
frames.push(rf);
|
frames.push(rf);
|
||||||
}
|
}
|
||||||
|
|
@ -165,7 +164,6 @@ class RewindManager {
|
||||||
level.marble.camera.oob = rf.oobState.oob;
|
level.marble.camera.oob = rf.oobState.oob;
|
||||||
level.outOfBoundsTime = rf.oobState.timeState != null ? rf.oobState.timeState.clone() : null;
|
level.outOfBoundsTime = rf.oobState.timeState != null ? rf.oobState.timeState.clone() : null;
|
||||||
level.blastAmount = rf.blastAmt;
|
level.blastAmount = rf.blastAmt;
|
||||||
@:privateAccess level.checkpointUp = rf.checkpointState.checkpointUp;
|
|
||||||
@:privateAccess level.checkpointCollectedGems = rf.checkpointState.checkpointCollectedGems;
|
@:privateAccess level.checkpointCollectedGems = rf.checkpointState.checkpointCollectedGems;
|
||||||
@:privateAccess level.cheeckpointBlast = rf.checkpointState.checkpointBlast;
|
@:privateAccess level.cheeckpointBlast = rf.checkpointState.checkpointBlast;
|
||||||
@:privateAccess level.checkpointHeldPowerup = rf.checkpointState.checkpointHeldPowerup;
|
@:privateAccess level.checkpointHeldPowerup = rf.checkpointState.checkpointHeldPowerup;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package triggers;
|
package triggers;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementSimGroup;
|
||||||
import shapes.Checkpoint;
|
import shapes.Checkpoint;
|
||||||
import h3d.Vector;
|
import h3d.Vector;
|
||||||
import src.MarbleWorld;
|
import src.MarbleWorld;
|
||||||
|
|
@ -10,7 +11,7 @@ import mis.MisParser;
|
||||||
class CheckpointTrigger extends Trigger {
|
class CheckpointTrigger extends Trigger {
|
||||||
public var disableOOB = false;
|
public var disableOOB = false;
|
||||||
public var add:Vector = null;
|
public var add:Vector = null;
|
||||||
public var checkpoint:Checkpoint;
|
public var simGroup:MissionElementSimGroup;
|
||||||
public var seqNum:Int;
|
public var seqNum:Int;
|
||||||
|
|
||||||
override public function new(element:MissionElementTrigger, level:MarbleWorld) {
|
override public function new(element:MissionElementTrigger, level:MarbleWorld) {
|
||||||
|
|
@ -29,13 +30,16 @@ class CheckpointTrigger extends Trigger {
|
||||||
|
|
||||||
public override function onMarbleEnter(time:src.TimeState) {
|
public override function onMarbleEnter(time:src.TimeState) {
|
||||||
super.onMarbleEnter(time);
|
super.onMarbleEnter(time);
|
||||||
var shape = checkpoint;
|
if (simGroup == null)
|
||||||
if (shape == null)
|
|
||||||
return;
|
return;
|
||||||
if (this.level.saveCheckpointState(shape, this)) {
|
var shape = level.simGroups[simGroup].filter(x -> x.identifier == "Checkpoint");
|
||||||
shape.lastActivatedTime = time.timeSinceLoad;
|
if (shape.length == 0)
|
||||||
|
return;
|
||||||
|
var chk:Checkpoint = cast shape[0];
|
||||||
|
if (this.level.saveCheckpointState(chk, this)) {
|
||||||
|
chk.lastActivatedTime = time.timeSinceLoad;
|
||||||
for (obj in this.level.dtsObjects) {
|
for (obj in this.level.dtsObjects) {
|
||||||
if (obj.identifier == "Checkpoint" && obj != shape)
|
if (obj.identifier == "Checkpoint" && obj != chk)
|
||||||
cast(obj, Checkpoint).lastActivatedTime = Math.POSITIVE_INFINITY;
|
cast(obj, Checkpoint).lastActivatedTime = Math.POSITIVE_INFINITY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ import src.AudioManager;
|
||||||
class HelpTrigger extends Trigger {
|
class HelpTrigger extends Trigger {
|
||||||
override function onMarbleEnter(timeState:TimeState) {
|
override function onMarbleEnter(timeState:TimeState) {
|
||||||
AudioManager.playSound(ResourceLoader.getResource('data/sound/infotutorial.wav', ResourceLoader.getAudio, this.soundResources));
|
AudioManager.playSound(ResourceLoader.getResource('data/sound/infotutorial.wav', ResourceLoader.getAudio, this.soundResources));
|
||||||
this.level.displayHelp(this.element.text);
|
if (this.element.text != null && this.element.text != "")
|
||||||
|
this.level.displayHelp(this.element.text);
|
||||||
// this.level.replay.recordMarbleEnter(this);
|
// this.level.replay.recordMarbleEnter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue