diff --git a/data/images/gfx64/button.png b/data/images/gfx64/button.png new file mode 100644 index 0000000..df5c23d Binary files /dev/null and b/data/images/gfx64/button.png differ diff --git a/data/images/gfx64/tiles.png b/data/images/gfx64/tiles.png index 8b48260..17a8ad6 100644 Binary files a/data/images/gfx64/tiles.png and b/data/images/gfx64/tiles.png differ diff --git a/index.html b/index.html index f5afdf2..d3be62d 100644 --- a/index.html +++ b/index.html @@ -15,12 +15,12 @@ var levelSelectorState = new Kiwi.State('levelSelector'); levelSelectorState.preload = function() { - this.addSpriteSheet('finishMarker', './data/images/gfx64/finish_marker.png', 64, 64 ); + this.addSpriteSheet('button', './data/images/gfx64/button.png', 128, 64 ); } levelSelectorState.create = function() { - this.text = new Kiwi.GameObjects.Textfield( this, "Start", 50, 60, "#000", 32, 'normal', 'Impact' ); - this.sprite = new Kiwi.GameObjects.Sprite(this, this.textures.finishMarker, 50, 50); + this.text = new Kiwi.GameObjects.Textfield( this, "Start", 66, 60, "#000", 32, 'normal', 'Impact' ); + this.sprite = new Kiwi.GameObjects.Sprite(this, this.textures.button, 50, 50); this.sprite.input.onUp.add( this.buttonReleased, this ); this.addChild( this.sprite ); this.addChild( this.text ); @@ -38,6 +38,7 @@ state.preload = function() { this.addSpriteSheet('character', './data/images/gfx64/marble_black.png', 80, 80 ); this.addSpriteSheet('oneWay', './data/images/gfx64/st_oneway.png', 64, 64 ); this.addSpriteSheet('finishMarker', './data/images/gfx64/finish_marker.png', 64, 64 ); + this.addSpriteSheet('button', './data/images/gfx64/button.png', 128, 64 ); } state.create = function() { @@ -101,9 +102,10 @@ state.create = function() { this.stageState = 'init'; - this.myButton = new Kiwi.GameObjects.Textfield( this, "Start", 260, 50, "#000", 32, 'normal', 'Impact' ); - this.sprite = new Kiwi.GameObjects.Sprite(this, this.textures.finishMarker, 260, 50); + this.myButton = new Kiwi.GameObjects.Textfield( this, "Start", 9*64+16, 60, "#000", 32, 'normal', 'Impact' ); + this.sprite = new Kiwi.GameObjects.Sprite(this, this.textures.button, 9*64, 50); this.sprite.input.onUp.add( this.buttonReleased, this ); + this.character.input.onUp.add( this.buttonReleased, this ); this.addChild( this.sprite ); this.addChild( this.myButton ); } @@ -219,7 +221,7 @@ state.checkCollision = function () { if (((Math.round(positionX/64) == Math.round(this.finishMarker.x/64) )) && (Math.round(positionY/64) == Math.round(this.finishMarker.y/64))) { this.stageState = 'complete'; - this.myButton.text = 'Next level' + this.myButton.text = 'Next->' this.character.physics.velocity.x = 0; this.character.physics.velocity.y = 0; } diff --git a/tilemap.json b/tilemap.json index 217f223..2fc89cf 100644 --- a/tilemap.json +++ b/tilemap.json @@ -1,7 +1,7 @@ { "height":6, "layers":[ { - "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 1, 1, 1, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":6, "name":"ground", "opacity":1,