mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
Small Fixes
This commit is contained in:
parent
0f4ccde6dc
commit
7b7d07707c
15 changed files with 123 additions and 66 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
-cp src
|
-cp src
|
||||||
-lib headbutt
|
|
||||||
-lib heaps
|
-lib heaps
|
||||||
-lib hlsdl
|
-lib hlsdl
|
||||||
-lib polygonal-ds
|
|
||||||
-hl native/marblegame.c
|
-hl native/marblegame.c
|
||||||
--main Main
|
--main Main
|
||||||
-debug
|
-debug
|
||||||
|
|
@ -101,12 +101,12 @@ class CameraController extends Object {
|
||||||
function orbit(mouseX:Float, mouseY:Float) {
|
function orbit(mouseX:Float, mouseY:Float) {
|
||||||
var window = Window.getInstance();
|
var window = Window.getInstance();
|
||||||
var deltaposX = (window.width / 2) - mouseX;
|
var deltaposX = (window.width / 2) - mouseX;
|
||||||
var deltaposY = (window.height / 2) - mouseY;
|
var deltaposY = (window.height / 2) - mouseY * (Settings.controlsSettings.invertYAxis ? -1 : 1);
|
||||||
if (!Settings.controlsSettings.alwaysFreeLook && !Key.isDown(Settings.controlsSettings.freelook)) {
|
if (!Settings.controlsSettings.alwaysFreeLook && !Key.isDown(Settings.controlsSettings.freelook)) {
|
||||||
deltaposY = 0;
|
deltaposY = 0;
|
||||||
}
|
}
|
||||||
var rotX = deltaposX * 0.001 * CameraSensitivity * Math.PI * 2;
|
var rotX = deltaposX * 0.001 * Settings.controlsSettings.cameraSensitivity * Math.PI * 2;
|
||||||
var rotY = deltaposY * 0.001 * CameraSensitivity * Math.PI * 2;
|
var rotY = deltaposY * 0.001 * Settings.controlsSettings.cameraSensitivity * Math.PI * 2;
|
||||||
CameraYaw -= rotX;
|
CameraYaw -= rotX;
|
||||||
CameraPitch += rotY;
|
CameraPitch += rotY;
|
||||||
// CameraYaw = Math.PI / 2;
|
// CameraYaw = Math.PI / 2;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package src;
|
package src;
|
||||||
|
|
||||||
|
import src.Settings;
|
||||||
import gui.LoadingGui;
|
import gui.LoadingGui;
|
||||||
import gui.PlayMissionGui;
|
import gui.PlayMissionGui;
|
||||||
import src.MarbleGame;
|
import src.MarbleGame;
|
||||||
|
|
@ -397,29 +398,29 @@ class MarbleWorld extends Scheduler {
|
||||||
shape = new Gem(cast element);
|
shape = new Gem(cast element);
|
||||||
this.totalGems++;
|
this.totalGems++;
|
||||||
} else if (dataBlockLowerCase == "superjumpitem")
|
} else if (dataBlockLowerCase == "superjumpitem")
|
||||||
shape = new SuperJump();
|
shape = new SuperJump(cast element);
|
||||||
else if (StringTools.startsWith(dataBlockLowerCase, "signcaution"))
|
else if (StringTools.startsWith(dataBlockLowerCase, "signcaution"))
|
||||||
shape = new SignCaution(element);
|
shape = new SignCaution(element);
|
||||||
else if (dataBlockLowerCase == "superbounceitem")
|
else if (dataBlockLowerCase == "superbounceitem")
|
||||||
shape = new SuperBounce();
|
shape = new SuperBounce(cast element);
|
||||||
else if (dataBlockLowerCase == "roundbumper")
|
else if (dataBlockLowerCase == "roundbumper")
|
||||||
shape = new RoundBumper();
|
shape = new RoundBumper();
|
||||||
else if (dataBlockLowerCase == "trianglebumper")
|
else if (dataBlockLowerCase == "trianglebumper")
|
||||||
shape = new TriangleBumper();
|
shape = new TriangleBumper();
|
||||||
else if (dataBlockLowerCase == "helicopteritem")
|
else if (dataBlockLowerCase == "helicopteritem")
|
||||||
shape = new Helicopter();
|
shape = new Helicopter(cast element);
|
||||||
else if (dataBlockLowerCase == "ductfan")
|
else if (dataBlockLowerCase == "ductfan")
|
||||||
shape = new DuctFan();
|
shape = new DuctFan();
|
||||||
else if (dataBlockLowerCase == "smallductfan")
|
else if (dataBlockLowerCase == "smallductfan")
|
||||||
shape = new SmallDuctFan();
|
shape = new SmallDuctFan();
|
||||||
else if (dataBlockLowerCase == "antigravityitem")
|
else if (dataBlockLowerCase == "antigravityitem")
|
||||||
shape = new AntiGravity();
|
shape = new AntiGravity(cast element);
|
||||||
else if (dataBlockLowerCase == "landmine")
|
else if (dataBlockLowerCase == "landmine")
|
||||||
shape = new LandMine();
|
shape = new LandMine();
|
||||||
else if (dataBlockLowerCase == "shockabsorberitem")
|
else if (dataBlockLowerCase == "shockabsorberitem")
|
||||||
shape = new ShockAbsorber();
|
shape = new ShockAbsorber(cast element);
|
||||||
else if (dataBlockLowerCase == "superspeeditem")
|
else if (dataBlockLowerCase == "superspeeditem")
|
||||||
shape = new SuperSpeed();
|
shape = new SuperSpeed(cast element);
|
||||||
else if (dataBlockLowerCase == "timetravelitem")
|
else if (dataBlockLowerCase == "timetravelitem")
|
||||||
shape = new TimeTravel(cast element);
|
shape = new TimeTravel(cast element);
|
||||||
else if (dataBlockLowerCase == "tornado")
|
else if (dataBlockLowerCase == "tornado")
|
||||||
|
|
@ -475,27 +476,27 @@ class MarbleWorld extends Scheduler {
|
||||||
shape = new Gem(cast element);
|
shape = new Gem(cast element);
|
||||||
this.totalGems++;
|
this.totalGems++;
|
||||||
} else if (dataBlockLowerCase == "superjumpitem")
|
} else if (dataBlockLowerCase == "superjumpitem")
|
||||||
shape = new SuperJump();
|
shape = new SuperJump(cast element);
|
||||||
else if (dataBlockLowerCase == "superbounceitem")
|
else if (dataBlockLowerCase == "superbounceitem")
|
||||||
shape = new SuperBounce();
|
shape = new SuperBounce(cast element);
|
||||||
else if (dataBlockLowerCase == "roundbumper")
|
else if (dataBlockLowerCase == "roundbumper")
|
||||||
shape = new RoundBumper();
|
shape = new RoundBumper();
|
||||||
else if (dataBlockLowerCase == "trianglebumper")
|
else if (dataBlockLowerCase == "trianglebumper")
|
||||||
shape = new TriangleBumper();
|
shape = new TriangleBumper();
|
||||||
else if (dataBlockLowerCase == "helicopteritem")
|
else if (dataBlockLowerCase == "helicopteritem")
|
||||||
shape = new Helicopter();
|
shape = new Helicopter(cast element);
|
||||||
else if (dataBlockLowerCase == "ductfan")
|
else if (dataBlockLowerCase == "ductfan")
|
||||||
shape = new DuctFan();
|
shape = new DuctFan();
|
||||||
else if (dataBlockLowerCase == "smallductfan")
|
else if (dataBlockLowerCase == "smallductfan")
|
||||||
shape = new SmallDuctFan();
|
shape = new SmallDuctFan();
|
||||||
else if (dataBlockLowerCase == "antigravityitem")
|
else if (dataBlockLowerCase == "antigravityitem")
|
||||||
shape = new AntiGravity();
|
shape = new AntiGravity(cast element);
|
||||||
else if (dataBlockLowerCase == "landmine")
|
else if (dataBlockLowerCase == "landmine")
|
||||||
shape = new LandMine();
|
shape = new LandMine();
|
||||||
else if (dataBlockLowerCase == "shockabsorberitem")
|
else if (dataBlockLowerCase == "shockabsorberitem")
|
||||||
shape = new ShockAbsorber();
|
shape = new ShockAbsorber(cast element);
|
||||||
else if (dataBlockLowerCase == "superspeeditem")
|
else if (dataBlockLowerCase == "superspeeditem")
|
||||||
shape = new SuperSpeed();
|
shape = new SuperSpeed(cast element);
|
||||||
else if (dataBlockLowerCase == "timetravelitem")
|
else if (dataBlockLowerCase == "timetravelitem")
|
||||||
shape = new TimeTravel(cast element);
|
shape = new TimeTravel(cast element);
|
||||||
else if (dataBlockLowerCase == "tornado")
|
else if (dataBlockLowerCase == "tornado")
|
||||||
|
|
@ -665,6 +666,45 @@ class MarbleWorld extends Scheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHelp(text:String) {
|
public function displayHelp(text:String) {
|
||||||
|
var start = 0;
|
||||||
|
var pos = text.indexOf("<func:", start);
|
||||||
|
while (pos != -1) {
|
||||||
|
var end = text.indexOf(">", start + 5);
|
||||||
|
if (end == -1)
|
||||||
|
break;
|
||||||
|
var pre = text.substr(0, pos);
|
||||||
|
var post = text.substr(end + 1);
|
||||||
|
var func = text.substr(pos + 6, end - (pos + 6));
|
||||||
|
var funcdata = func.split(' ');
|
||||||
|
var val = "";
|
||||||
|
if (funcdata[0] == "bind") {
|
||||||
|
if (funcdata[1] == "moveforward")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.forward);
|
||||||
|
if (funcdata[1] == "movebackward")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.backward);
|
||||||
|
if (funcdata[1] == "moveleft")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.left);
|
||||||
|
if (funcdata[1] == "moveright")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.right);
|
||||||
|
if (funcdata[1] == "panup")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.camForward);
|
||||||
|
if (funcdata[1] == "pandown")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.camBackward);
|
||||||
|
if (funcdata[1] == "panleft")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.camLeft);
|
||||||
|
if (funcdata[1] == "panright")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.camRight);
|
||||||
|
if (funcdata[1] == "jump")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.jump);
|
||||||
|
if (funcdata[1] == "mousefire")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.powerup);
|
||||||
|
if (funcdata[1] == "freelook")
|
||||||
|
val = Key.getKeyName(Settings.controlsSettings.freelook);
|
||||||
|
}
|
||||||
|
start = val.length + pos;
|
||||||
|
text = pre + val + post;
|
||||||
|
pos = text.indexOf("<func:", start);
|
||||||
|
}
|
||||||
this.playGui.setHelpText(text);
|
this.playGui.setHelpText(text);
|
||||||
this.helpTextTimeState = this.timeState.currentAttemptTime;
|
this.helpTextTimeState = this.timeState.currentAttemptTime;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ typedef ControlsSettings = {
|
||||||
var powerup:Int;
|
var powerup:Int;
|
||||||
var freelook:Int;
|
var freelook:Int;
|
||||||
var alwaysFreeLook:Bool;
|
var alwaysFreeLook:Bool;
|
||||||
|
var cameraSensitivity:Float;
|
||||||
|
var invertYAxis:Bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Settings {
|
class Settings {
|
||||||
|
|
@ -65,7 +67,9 @@ class Settings {
|
||||||
jump: Key.SPACE,
|
jump: Key.SPACE,
|
||||||
powerup: Key.MOUSE_LEFT,
|
powerup: Key.MOUSE_LEFT,
|
||||||
freelook: Key.MOUSE_RIGHT,
|
freelook: Key.MOUSE_RIGHT,
|
||||||
alwaysFreeLook: true
|
alwaysFreeLook: true,
|
||||||
|
cameraSensitivity: 0.6,
|
||||||
|
invertYAxis: false
|
||||||
};
|
};
|
||||||
|
|
||||||
public static function applySettings() {
|
public static function applySettings() {
|
||||||
|
|
@ -73,6 +77,7 @@ class Settings {
|
||||||
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
||||||
|
|
||||||
MarbleGame.canvas.render(MarbleGame.canvas.scene2d);
|
MarbleGame.canvas.render(MarbleGame.canvas.scene2d);
|
||||||
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function saveScore(mapPath:String, score:Score) {
|
public static function saveScore(mapPath:String, score:Score) {
|
||||||
|
|
@ -96,7 +101,9 @@ class Settings {
|
||||||
|
|
||||||
public static function save() {
|
public static function save() {
|
||||||
var outputData = {
|
var outputData = {
|
||||||
highScores: highScores
|
highScores: highScores,
|
||||||
|
options: optionsSettings,
|
||||||
|
controls: controlsSettings
|
||||||
};
|
};
|
||||||
var json = Json.stringify(outputData);
|
var json = Json.stringify(outputData);
|
||||||
File.saveContent("settings.json", json);
|
File.saveContent("settings.json", json);
|
||||||
|
|
@ -109,6 +116,8 @@ class Settings {
|
||||||
for (key => value in highScoreData) {
|
for (key => value in highScoreData) {
|
||||||
highScores.set(key, value);
|
highScores.set(key, value);
|
||||||
}
|
}
|
||||||
|
optionsSettings = json.options;
|
||||||
|
controlsSettings = json.controls;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,16 +55,31 @@ class Collision {
|
||||||
var p = PlaneF.PointNormal(new Point3F(v0.x, v0.y, v0.z), new Point3F(normal.x, normal.y, normal.z));
|
var p = PlaneF.PointNormal(new Point3F(v0.x, v0.y, v0.z), new Point3F(normal.x, normal.y, normal.z));
|
||||||
var pdist = p.distance(new Point3F(center.x, center.y, center.z));
|
var pdist = p.distance(new Point3F(center.x, center.y, center.z));
|
||||||
|
|
||||||
if (Math.abs(pdist) < 0.001) {
|
if (pdist < 0.001) {
|
||||||
return res; // Dont collide internal edges
|
return res; // Dont collide internal edges
|
||||||
}
|
}
|
||||||
|
|
||||||
function toDifPoint(pt:Vector) {
|
// Check edges
|
||||||
return new Point3F(pt.x, pt.y, pt.z);
|
var r1 = IntersectLineSphere(v0, v1, center, radius);
|
||||||
|
if (r1 != null) {
|
||||||
|
res.result = true;
|
||||||
|
res.point = r1;
|
||||||
|
res.normal = center.sub(r1).normalized();
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
var r2 = IntersectLineSphere(v1, v2, center, radius);
|
||||||
function fromDifPoint(pt:Point3F) {
|
if (r2 != null) {
|
||||||
return new Vector(pt.x, pt.y, pt.z);
|
res.result = true;
|
||||||
|
res.point = r2;
|
||||||
|
res.normal = center.sub(r2).normalized();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
var r3 = IntersectLineSphere(v2, v0, center, radius);
|
||||||
|
if (r3 != null) {
|
||||||
|
res.result = true;
|
||||||
|
res.point = r3;
|
||||||
|
res.normal = center.sub(r3).normalized();
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pdist < radius) {
|
if (pdist < radius) {
|
||||||
|
|
@ -105,29 +120,6 @@ class Collision {
|
||||||
// return res;
|
// return res;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Check edges
|
|
||||||
var r1 = IntersectLineSphere(v0, v1, center, radius);
|
|
||||||
if (r1 != null) {
|
|
||||||
res.result = true;
|
|
||||||
res.point = r1;
|
|
||||||
res.normal = center.sub(r1).normalized();
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
var r2 = IntersectLineSphere(v1, v2, center, radius);
|
|
||||||
if (r2 != null) {
|
|
||||||
res.result = true;
|
|
||||||
res.point = r2;
|
|
||||||
res.normal = center.sub(r2).normalized();
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
var r3 = IntersectLineSphere(v2, v0, center, radius);
|
|
||||||
if (r3 != null) {
|
|
||||||
res.result = true;
|
|
||||||
res.point = r3;
|
|
||||||
res.normal = center.sub(r3).normalized();
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check plane
|
// Check plane
|
||||||
// var p = PlaneF.ThreePoints(toDifPoint(v0), toDifPoint(v1), toDifPoint(v2));
|
// var p = PlaneF.ThreePoints(toDifPoint(v0), toDifPoint(v1), toDifPoint(v2));
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -73,11 +73,13 @@ class OptionsDlg extends GuiImage {
|
||||||
graphicsPane.extent = new Vector(438, 298);
|
graphicsPane.extent = new Vector(438, 298);
|
||||||
|
|
||||||
mainPane.addChild(graphicsPane);
|
mainPane.addChild(graphicsPane);
|
||||||
|
var applyFunc:Void->Void = null;
|
||||||
|
|
||||||
var mainMenuButton = new GuiButton(loadButtonImages("data/ui/options/mainm"));
|
var mainMenuButton = new GuiButton(loadButtonImages("data/ui/options/mainm"));
|
||||||
mainMenuButton.position = new Vector(330, 356);
|
mainMenuButton.position = new Vector(330, 356);
|
||||||
mainMenuButton.extent = new Vector(121, 53);
|
mainMenuButton.extent = new Vector(121, 53);
|
||||||
mainMenuButton.pressedAction = (sender) -> {
|
mainMenuButton.pressedAction = (sender) -> {
|
||||||
|
applyFunc();
|
||||||
MarbleGame.canvas.setContent(new MainMenuGui());
|
MarbleGame.canvas.setContent(new MainMenuGui());
|
||||||
}
|
}
|
||||||
mainPane.addChild(mainMenuButton);
|
mainPane.addChild(mainMenuButton);
|
||||||
|
|
@ -205,8 +207,6 @@ class OptionsDlg extends GuiImage {
|
||||||
}
|
}
|
||||||
graphicsPane.addChild(gfxd3d);
|
graphicsPane.addChild(gfxd3d);
|
||||||
|
|
||||||
var applyFunc:Void->Void = null;
|
|
||||||
|
|
||||||
var applyButton = new GuiButton(loadButtonImages("data/ui/options/grafapply"));
|
var applyButton = new GuiButton(loadButtonImages("data/ui/options/grafapply"));
|
||||||
applyButton.position = new Vector(188, 239);
|
applyButton.position = new Vector(188, 239);
|
||||||
applyButton.extent = new Vector(106, 60);
|
applyButton.extent = new Vector(106, 60);
|
||||||
|
|
@ -577,6 +577,10 @@ Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3";
|
||||||
invertAxis.position = new Vector(95, 249);
|
invertAxis.position = new Vector(95, 249);
|
||||||
invertAxis.extent = new Vector(43, 53);
|
invertAxis.extent = new Vector(43, 53);
|
||||||
invertAxis.buttonType = Toggle;
|
invertAxis.buttonType = Toggle;
|
||||||
|
invertAxis.pressed = Settings.controlsSettings.invertYAxis;
|
||||||
|
invertAxis.pressedAction = (sender) -> {
|
||||||
|
Settings.controlsSettings.invertYAxis = !Settings.controlsSettings.invertYAxis;
|
||||||
|
}
|
||||||
mouseControlsPane.addChild(invertAxis);
|
mouseControlsPane.addChild(invertAxis);
|
||||||
|
|
||||||
var alwaysFreelook = new GuiButton(loadButtonImages("data/ui/options/cntrl_mous_freel"));
|
var alwaysFreelook = new GuiButton(loadButtonImages("data/ui/options/cntrl_mous_freel"));
|
||||||
|
|
@ -592,6 +596,10 @@ Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3";
|
||||||
var mouseSensitivity = new GuiSlider(ResourceLoader.getImage("data/ui/options/cntrl_mous_knb.png").toTile());
|
var mouseSensitivity = new GuiSlider(ResourceLoader.getImage("data/ui/options/cntrl_mous_knb.png").toTile());
|
||||||
mouseSensitivity.position = new Vector(147, 148);
|
mouseSensitivity.position = new Vector(147, 148);
|
||||||
mouseSensitivity.extent = new Vector(254, 34);
|
mouseSensitivity.extent = new Vector(254, 34);
|
||||||
|
mouseSensitivity.sliderValue = (Settings.controlsSettings.cameraSensitivity - 0.2) / (3 - 0.2);
|
||||||
|
mouseSensitivity.pressedAction = (sender) -> {
|
||||||
|
Settings.controlsSettings.cameraSensitivity = 0.2 + (3 - 0.2) * mouseSensitivity.sliderValue;
|
||||||
|
}
|
||||||
mouseControlsPane.addChild(mouseSensitivity);
|
mouseControlsPane.addChild(mouseSensitivity);
|
||||||
|
|
||||||
// INVISIBLE BUTTON SHIT
|
// INVISIBLE BUTTON SHIT
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
package shapes;
|
package shapes;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementItem;
|
||||||
import src.TimeState;
|
import src.TimeState;
|
||||||
import h3d.Vector;
|
import h3d.Vector;
|
||||||
import src.DtsObject;
|
import src.DtsObject;
|
||||||
|
|
||||||
class AntiGravity extends PowerUp {
|
class AntiGravity extends PowerUp {
|
||||||
public function new() {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super(element);
|
||||||
this.dtsPath = "data/shapes/items/antigravity.dts";
|
this.dtsPath = "data/shapes/items/antigravity.dts";
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.isTSStatic = false;
|
this.isTSStatic = false;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
package shapes;
|
package shapes;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementItem;
|
||||||
import src.TimeState;
|
import src.TimeState;
|
||||||
import src.DtsObject;
|
import src.DtsObject;
|
||||||
|
|
||||||
class Helicopter extends PowerUp {
|
class Helicopter extends PowerUp {
|
||||||
public function new() {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super(element);
|
||||||
this.dtsPath = "data/shapes/images/helicopter.dts";
|
this.dtsPath = "data/shapes/images/helicopter.dts";
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.isTSStatic = false;
|
this.isTSStatic = false;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package shapes;
|
package shapes;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementItem;
|
||||||
import src.TimeState;
|
import src.TimeState;
|
||||||
import src.Util;
|
import src.Util;
|
||||||
import h3d.Vector;
|
import h3d.Vector;
|
||||||
|
|
@ -29,11 +30,13 @@ abstract class PowerUp extends DtsObject {
|
||||||
public var autoUse:Bool = false;
|
public var autoUse:Bool = false;
|
||||||
public var powerupParams:PowerupParams = new PowerupParams();
|
public var powerupParams:PowerupParams = new PowerupParams();
|
||||||
public var pickUpName:String;
|
public var pickUpName:String;
|
||||||
|
public var element:MissionElementItem;
|
||||||
|
|
||||||
public function new() {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super();
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.ambientRotate = true;
|
this.ambientRotate = true;
|
||||||
|
this.element = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function onMarbleInside(timeState:TimeState) {
|
public override function onMarbleInside(timeState:TimeState) {
|
||||||
|
|
@ -49,7 +52,8 @@ abstract class PowerUp extends DtsObject {
|
||||||
this.use(timeState);
|
this.use(timeState);
|
||||||
|
|
||||||
this.level.displayAlert('You picked up a ${this.pickUpName}!');
|
this.level.displayAlert('You picked up a ${this.pickUpName}!');
|
||||||
// if (this.element.showhelponpickup === "1" && !this.autoUse) displayHelp(`Press <func:bind mousefire> to use the ${this.pickUpName}!`);
|
if (this.element.showhelponpickup == "1" && !this.autoUse)
|
||||||
|
this.level.displayHelp('Press <func:bind mousefire> to use the ${this.pickUpName}!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
package shapes;
|
package shapes;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementItem;
|
||||||
import src.TimeState;
|
import src.TimeState;
|
||||||
import src.DtsObject;
|
import src.DtsObject;
|
||||||
|
|
||||||
class ShockAbsorber extends PowerUp {
|
class ShockAbsorber extends PowerUp {
|
||||||
public function new() {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super(element);
|
||||||
this.dtsPath = "data/shapes/items/shockabsorber.dts";
|
this.dtsPath = "data/shapes/items/shockabsorber.dts";
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.isTSStatic = false;
|
this.isTSStatic = false;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
package shapes;
|
package shapes;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementItem;
|
||||||
import src.TimeState;
|
import src.TimeState;
|
||||||
import src.DtsObject;
|
import src.DtsObject;
|
||||||
|
|
||||||
class SuperBounce extends PowerUp {
|
class SuperBounce extends PowerUp {
|
||||||
public function new() {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super(element);
|
||||||
this.dtsPath = "data/shapes/items/superbounce.dts";
|
this.dtsPath = "data/shapes/items/superbounce.dts";
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.isTSStatic = false;
|
this.isTSStatic = false;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package shapes;
|
package shapes;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementItem;
|
||||||
import src.TimeState;
|
import src.TimeState;
|
||||||
import src.ResourceLoader;
|
import src.ResourceLoader;
|
||||||
import src.ParticleSystem.ParticleData;
|
import src.ParticleSystem.ParticleData;
|
||||||
|
|
@ -32,8 +33,8 @@ final superJumpParticleOptions:src.ParticleSystem.ParticleEmitterOptions = {
|
||||||
class SuperJump extends PowerUp {
|
class SuperJump extends PowerUp {
|
||||||
var sjEmitterParticleData:ParticleData;
|
var sjEmitterParticleData:ParticleData;
|
||||||
|
|
||||||
public function new() {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super(element);
|
||||||
this.dtsPath = "data/shapes/items/superjump.dts";
|
this.dtsPath = "data/shapes/items/superjump.dts";
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.isTSStatic = false;
|
this.isTSStatic = false;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package shapes;
|
package shapes;
|
||||||
|
|
||||||
|
import mis.MissionElement.MissionElementItem;
|
||||||
import src.TimeState;
|
import src.TimeState;
|
||||||
import src.ResourceLoader;
|
import src.ResourceLoader;
|
||||||
import src.ParticleSystem.ParticleData;
|
import src.ParticleSystem.ParticleData;
|
||||||
|
|
@ -38,8 +39,8 @@ final superSpeedParticleOptions:ParticleEmitterOptions = {
|
||||||
class SuperSpeed extends PowerUp {
|
class SuperSpeed extends PowerUp {
|
||||||
var ssEmitterParticleData:ParticleData;
|
var ssEmitterParticleData:ParticleData;
|
||||||
|
|
||||||
public function new() {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super(element);
|
||||||
this.dtsPath = "data/shapes/items/superspeed.dts";
|
this.dtsPath = "data/shapes/items/superspeed.dts";
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.isTSStatic = false;
|
this.isTSStatic = false;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ class TimeTravel extends PowerUp {
|
||||||
var timeBonus:Float = 5;
|
var timeBonus:Float = 5;
|
||||||
|
|
||||||
public function new(element:MissionElementItem) {
|
public function new(element:MissionElementItem) {
|
||||||
super();
|
super(element);
|
||||||
this.dtsPath = "data/shapes/items/timetravel.dts";
|
this.dtsPath = "data/shapes/items/timetravel.dts";
|
||||||
this.isCollideable = false;
|
this.isCollideable = false;
|
||||||
this.isTSStatic = false;
|
this.isTSStatic = false;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import src.ForceObject;
|
||||||
|
|
||||||
class Trapdoor extends DtsObject {
|
class Trapdoor extends DtsObject {
|
||||||
var lastContactTime = -1e8;
|
var lastContactTime = -1e8;
|
||||||
var timeout:Float = 0;
|
var timeout:Float = 0.2;
|
||||||
var lastDirection:Float;
|
var lastDirection:Float;
|
||||||
var lastCompletion:Float = 0;
|
var lastCompletion:Float = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue