Prevent moving ship if inventory screen is open. Also resize map.
This commit is contained in:
parent
aac13ca552
commit
3208d230bf
|
@ -1,8 +1,8 @@
|
|||
// var rm_TitleScreen = OS.R.Add("Default");
|
||||
// var rm_Ocean = OS.R.Add("Ocean", {
|
||||
var rm_Ocean = OS.R.Add("Default", {
|
||||
width: (64 * OS.S.pixelScale) * 64, //32 64x64 squares for the map.
|
||||
height: (64 * OS.S.pixelScale) * 64,
|
||||
width: (64 * OS.S.pixelScale) * 50, //50x50 map of 64x64 squares. This will allow a single pixel on the map to represent a 64x square and fit comfortably on screen.
|
||||
height: (64 * OS.S.pixelScale) * 50,
|
||||
backgroundColor: "#1b2632"
|
||||
});
|
||||
|
||||
|
|
|
@ -27,19 +27,22 @@ var pr_ship = OS.P.Add("Ship", {
|
|||
});
|
||||
|
||||
pr_ship.Do = function () {
|
||||
if (ct_left().down) {
|
||||
this.direction += 45;
|
||||
} else if (ct_right().down) {
|
||||
this.direction -= 45;
|
||||
if (!guiControl.inventory.show) {
|
||||
if (ct_left().down) {
|
||||
this.direction += 45;
|
||||
} else if (ct_right().down) {
|
||||
this.direction -= 45;
|
||||
}
|
||||
this.direction = Math.clampAngle(this.direction);
|
||||
|
||||
if (ct_up().down) {
|
||||
this.currentSpeed++;
|
||||
} else if (ct_down().down) {
|
||||
this.currentSpeed--;
|
||||
}
|
||||
this.AdjustSpeedBasedOnEnergy();
|
||||
}
|
||||
this.direction = Math.clampAngle(this.direction);
|
||||
|
||||
if (ct_up().down) {
|
||||
this.currentSpeed++;
|
||||
} else if (ct_down().down) {
|
||||
this.currentSpeed--;
|
||||
}
|
||||
this.AdjustSpeedBasedOnEnergy();
|
||||
this.currentSpeed = Math.clamp(this.currentSpeed, 0, 4);
|
||||
|
||||
this.moveStepProgress += this.currentSpeed * this.moveStepAmount;
|
||||
|
|
Loading…
Reference in New Issue