add info screen

This commit is contained in:
Juraj Michalek
2015-12-30 17:07:55 +01:00
parent b0604f9305
commit 7f4c12fb7d
5 changed files with 106 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
PF 2016 - Work in progress version
PF 2016 - Puzzle Game
----
This small game is electronic card for New Year 2016.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 166 KiB

View File

@@ -14,9 +14,23 @@
<script src="js/app/loading-state.js"></script>
<script src="js/app/level-tools.js"></script>
<script src="js/app/level-selector.js"></script>
<script src="js/app/info-state.js"></script>
<script src="js/app/instructions-state.js"></script>
<script src="js/app/game-state.js"></script>
<script src="js/app/levels-01-12.js"></script>
<!-- http://www.ysofters.com tracker -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker');
__gaTracker('create', 'UA-55273054-1', 'auto');
__gaTracker('set', 'forceSSL', true);
__gaTracker('require', 'displayfeatures');
__gaTracker('send','pageview');
</script>
</head>
<body>
@@ -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);

63
js/app/info-state.js Normal file
View File

@@ -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";
}

View File

@@ -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');