diff --git a/README.md b/README.md index c71cddf..3729543 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -PF 2016 - Work in progress version +PF 2016 - Puzzle Game ---- This small game is electronic card for New Year 2016. diff --git a/data/images/gfx64/tiles.png b/data/images/gfx64/tiles.png index 11ac63a..a22f53c 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 2ad5df9..8084df3 100644 --- a/index.html +++ b/index.html @@ -14,9 +14,23 @@ + + + + @@ -36,6 +50,7 @@ game.stage.color = "121d35"; game.levelIndex = 0; game.levelStatus = 'none'; game.states.addState(levelSelectorState); +game.states.addState(infoState); game.states.addState(instructionsState); game.states.addState(state); diff --git a/js/app/info-state.js b/js/app/info-state.js new file mode 100644 index 0000000..a976ece --- /dev/null +++ b/js/app/info-state.js @@ -0,0 +1,63 @@ +var infoState = new Kiwi.State('infoState'); + +infoState.create = function() { + var messageBox = new Kiwi.Plugins.Primitives.Rectangle( { + x: 64, + y: 72, + alpha: 0.5, + state: this, + width: 460, + height: 300, + color: '189608', + strokeColor: 'fbd712', + centerOnTransform: false + } ); + + this.addChild(messageBox); + + var baseY=280; + var button = new Kiwi.Plugins.Primitives.Rectangle( { + x: 300, + y: baseY+50, + state: this, + width: 160, + height: 50, + color: '2160e1', + strokeColor: '050e20', + centerOnTransform: true + } ); + this.addChild(button); + + var georgikButton = new Kiwi.Plugins.Primitives.Rectangle( { + x: 180, + y: 180, + state: this, + width: 300, + height: 32, + color: '2160e1', + strokeColor: '050e20', + centerOnTransform: false, + alpha: 0 + } ); + this.addChild(georgikButton); + + var text = new Kiwi.GameObjects.Textfield( this, "Ok", 285, baseY+30, "#fbd712", 32, 'normal', 'Impact' ); + this.addChild(text); + + this.addChild(new Kiwi.GameObjects.Textfield( this, "PF 2016 - Puzzle Game", 120, 100, "#fbd712", 32, 'normal', 'Impact' )); + this.addChild(new Kiwi.GameObjects.Textfield( this, "Author: Juraj Michálek", 120, 150, "#fbd712", 23, 'normal', 'Impact' )); + var georgikLink = new Kiwi.GameObjects.Textfield( this, "http://georgik.sinusgear.com", 180, 180, "#fbd712", 23, 'normal', 'Impact' ); + this.addChild(georgikLink); + this.addChild(new Kiwi.GameObjects.Textfield( this, "Technologies: Kiwi.JS, FontAwesome, ", 120, 220, "#fbd712", 23, 'normal', 'Impact' )); + this.addChild(new Kiwi.GameObjects.Textfield( this, "Enigma, Visual Studio Code, Linux", 180, 250, "#fbd712", 23, 'normal', 'Impact' )); + button.input.onUp.add(this.buttonReleased, this); + georgikButton.input.onUp.add(this.linkReleased, this); +} + +infoState.buttonReleased = function() { + game.states.switchState('levelSelector'); +} + +infoState.linkReleased = function() { + window.location.href = "http://georgik.sinusgear.com"; +} \ No newline at end of file diff --git a/js/app/level-selector.js b/js/app/level-selector.js index 97b982b..d8f5ff8 100644 --- a/js/app/level-selector.js +++ b/js/app/level-selector.js @@ -65,9 +65,36 @@ levelSelectorState.create = function() { counterX = 0; counterY++; } + + var ysoftLogo = new Kiwi.GameObjects.Sprite(this, this.textures.base, 270, 320); + ysoftLogo.cellIndex = 25; + ysoftLogo.input.onUp.add(this.ysoftLogoClick, this); + this.addChild(ysoftLogo); + + var githubLogo = new Kiwi.GameObjects.Sprite(this, this.textures.base, 360, 320); + githubLogo.cellIndex = 26; + githubLogo.input.onUp.add(this.githubLogoClick, this); + this.addChild(githubLogo); + + var info = new Kiwi.GameObjects.Sprite(this, this.textures.base, 190, 320); + info.cellIndex = 27; + info.input.onUp.add(this.infoClick, this); + this.addChild(info); } } +levelSelectorState.ysoftLogoClick = function() { + window.location.href = "http://www.ysofters.com/pf2016"; +} + +levelSelectorState.githubLogoClick = function() { + window.location.href = "https://github.com/ysoftdevs/pf2016"; +} + +levelSelectorState.infoClick = function() { + game.states.switchState('infoState'); +} + levelSelectorState.buttonReleased = function(sprite) { game.levelIndex = sprite.levelIndex; game.states.switchState('instructionsState');