diff --git a/Oversimplified.js b/Oversimplified.js index 949d81e..e0bd169 100644 --- a/Oversimplified.js +++ b/Oversimplified.js @@ -453,6 +453,13 @@ Oversimplified.Room = function (name, options) { self.foreground.src = options.foreground; self.foreground.onload = function () {this.loaded = true;} } + + // Set any extra properties from Options. + for (var property in options) { + if (typeof this[property] === 'undefined') { + this[property] = options[property]; + } + } this.drawOrder = []; @@ -634,9 +641,11 @@ Oversimplified.GameObject = function (name, options) {// x, y, imageSrc, maskIma } else { this.image = Oversimplified.emptyImage; } + this.image.xScale = typeof options.xScale !== 'undefined' ? options.xScale : 1; - this.image.yScale = typeof options.yScale !== 'undefined' ? options.yScale : 1; - this.image.rotation = typeof options.rotation !== 'undefined' ? options.rotation : 0; + this.image.yScale = typeof options.yScale !== 'undefined' ? options.yScale : this.image.xScale; + + this.image.rotation = typeof options.rotation !== 'undefined' ? Math.clampAngle(options.rotation) : 0; this.image.animations = {}; @@ -670,12 +679,12 @@ Oversimplified.GameObject = function (name, options) {// x, y, imageSrc, maskIma if (this.mask.src != "") { this.mask.onload = function(){ - self.xBound = this.width / 2; - self.yBound = this.height / 2; + self.xBound = this.width / 2 * self.image.xScale; + self.yBound = this.height / 2 * self.image.yScale; }; } else { - self.xBound = this.mask.width / 2; - self.yBound = this.mask.height / 2; + self.xBound = this.mask.width / 2 * self.image.xScale; + self.yBound = this.mask.height / 2 * self.image.yScale; } // Set any extra properties from Options. diff --git a/prefabs/shipPrefab.js b/prefabs/shipPrefab.js index 2271165..cc7e66f 100644 --- a/prefabs/shipPrefab.js +++ b/prefabs/shipPrefab.js @@ -20,7 +20,7 @@ var pr_ship = OS.P.Add("Ship", { moveStepSize: 3, moveStepAmount: 5 * Oversimplified.R[Oversimplified.R.currentRoom].stepSpeed, moveStepProgress: 0, - doTakeStep: false, + doTakeStep: false }); pr_ship.Do = function () { diff --git a/start.js b/start.js index d51e2f9..1853829 100644 --- a/start.js +++ b/start.js @@ -30,7 +30,7 @@ function drawPixelText(text, x, y, wrapWidth, color, size) { var letterSizeX = ((size == 6) ? size - 1 : size) * OS.S.pixelScale; var letterSizeY = size * OS.S.pixelScale; var maxWrapWidth = Math.floor(OS.camera.width / (letterSizeX + OS.S.pixelScale)); - console.log(maxWrapWidth); + wrapWidth = (wrapWidth <= 0 || wrapWidth > maxWrapWidth) ? maxWrapWidth : wrapWidth; var alphabet = new Image();