Commit 6e93e5ea authored by Matthew Odle's avatar Matthew Odle

move initials config to separate file - to be moved to canvas-libs

parent 49402815
......@@ -15,7 +15,7 @@ var metrics = {
// this.score = new Component(scoreParams);
// this.score.value = 0;
this.score.player1 = new Component(scoreParams);
this.score.player1.value = 10;
this.score.player1.value = 0;
scoreParams.x = 200;
this.score.player2 = new Component(scoreParams);
this.score.player2.value = 0;
......
......@@ -3,6 +3,7 @@ var init = {
console.log('init the things, yo');
knobsAndLevers.init();
templates.init();
initials.init();
menus.init();
game.init();
metrics.init();
......
/*jslint white: true */
var script = document.createElement('script');
script.src = 'https://rawgit.com/paulirish/memory-stats.js/master/bookmarklet.js';
document.head.appendChild(script);
var main = {
framesToWaitToPauseAgain : 0,
updateGameState : function() {
......
var initials = {
ignoreMarker : true,
order : ['left', 'middle', 'right', 'submit'],
options : ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
entries : {
previouser : {
noSelection: true,
fontSize : '15px',
defaultXAdjust : 7,
xAdjust : 7,
yAdjust : -10,
color : 'darkgrey',
},
previous : {
noSelection: true,
defaultXAdjust : 5,
xAdjust : 5,
yAdjust : -10,
color : 'grey',
},
left : {
text : 'A',
fontSize : '30px',
action : function() {
let order = menus.screens.initials.order;
menus.selectNextInitial();
menus.display('initials');
},
},
middle : {
text : 'A',
fontSize : '30px',
xAdjust : 40,
yAdjust : -25,
action : function() {
menus.selectNextInitial();
menus.display('initials');
},
},
right : {
text : 'A',
fontSize : '30px',
xAdjust : 80,
yAdjust : -50,
action : function() {
menus.selectNextInitial();
menus.display('initials');
},
},
next : {
noSelection: true,
defaultXAdjust : 5,
xAdjust : 5,
yAdjust : -50,
color : 'grey',
},
nexter : {
noSelection: true,
fontSize : '15px',
defaultXAdjust : 7,
xAdjust : 7,
yAdjust : -50,
color : 'darkgrey',
},
submit : {
text : 'Done',
fontSize : '30px',
xAdjust : 175,
yAdjust : -125,
submit : function() {
main.saveScore(menus.screens.initials.getEntries());
menus.display('main');
},
action : function() {
menus.selectNextInitial();
menus.display('initials');
},
},
},
getEntries : function() {
let entries = '';
['left', 'middle', 'right'].forEach(entry => entries += this.entries[entry].text);
return entries;
},
init : function() {
this.entries.left.options = this.options.slice();
this.entries.middle.options = this.options.slice();
this.entries.right.options = this.options.slice();
},
text : {
entries : [
{
name : 'enterInitials',
text : 'Enter your initials',
fontSize : '25px',
},
{
name : 'currentScore',
text : '',
xAdjust : 85,
yAdjust : 50,
fontSize : '20px',
},
],
},
};
......@@ -2,9 +2,8 @@ menus = {
leaderboards : undefined,
currentSelection : undefined,
init : function() {
menusProps.init();
Object.assign(this, menusProps);
console.log(templates.marker);
this.screens.initials = initials;
this.selectionMarker = Object.assign({}, templates.marker);
console.log('menus initialized');
},
......@@ -14,7 +13,6 @@ menus = {
reset : function() {
game.gameOver = false;
this.init();
// this.screens.initials.text.entries[2].text = '';
this.display(metrics.lastScore ? 'initials' : 'main');
},
display : function(menu) {
......
......@@ -11,9 +11,6 @@ var menuDefaults = {
};
var menusProps = {
init : function() {
this.screens.initials.init();
},
title : {
entries : [
{
......@@ -25,7 +22,6 @@ var menusProps = {
],
},
show : {
// TODO set main to true to load main menu
initials : false,
cheats : false,
main : true,
......@@ -118,121 +114,6 @@ var menusProps = {
],
},
},
initials : {
ignoreMarker : true,
order : ['left', 'middle', 'right', 'submit'],
options : ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
entries : {
previouser : {
noSelection: true,
fontSize : '15px',
defaultXAdjust : 7,
xAdjust : 7,
yAdjust : -10,
color : 'darkgrey',
},
previous : {
noSelection: true,
defaultXAdjust : 5,
xAdjust : 5,
yAdjust : -10,
color : 'grey',
},
left : {
text : 'A',
fontSize : '30px',
action : function() {
let order = menus.screens.initials.order;
menus.selectNextInitial();
menus.display('initials');
},
},
middle : {
text : 'A',
fontSize : '30px',
xAdjust : 40,
yAdjust : -25,
action : function() {
menus.selectNextInitial();
menus.display('initials');
},
},
right : {
text : 'A',
fontSize : '30px',
xAdjust : 80,
yAdjust : -50,
action : function() {
menus.selectNextInitial();
menus.display('initials');
},
},
next : {
noSelection: true,
defaultXAdjust : 5,
xAdjust : 5,
yAdjust : -50,
color : 'grey',
},
nexter : {
noSelection: true,
fontSize : '15px',
defaultXAdjust : 7,
xAdjust : 7,
yAdjust : -50,
color : 'darkgrey',
},
submit : {
text : 'Done',
fontSize : '30px',
xAdjust : 175,
yAdjust : -125,
submit : function() {
main.saveScore(menus.screens.initials.getEntries());
menus.display('main');
},
action : function() {
menus.selectNextInitial();
menus.display('initials');
},
},
},
getEntries : function() {
let entries = '';
['left', 'middle', 'right'].forEach(entry => entries += this.entries[entry].text);
return entries;
},
init : function() {
this.entries.left.options = this.options.slice();
this.entries.middle.options = this.options.slice();
this.entries.right.options = this.options.slice();
},
text : {
entries : [
{
name : 'enterInitials',
text : 'Enter your initials',
fontSize : '25px',
},
{
name : 'currentScore',
text : '',
xAdjust : 85,
yAdjust : 50,
fontSize : '20px',
},
],
},
},
instructions : {
order : ['back'],
entries : {
......
......@@ -37,9 +37,10 @@
<script src="app/scripts/game.js"></script>
<script src="app/scripts/hud.js"></script>
<script src="app/scripts/knobs-and-levers.js"></script>
<script src="app/scripts/properties/menus-props.js"></script>
<script src="app/scripts/main.js"></script>
<script src="app/scripts/menus.js"></script>
<script src="app/scripts/menus/properties/menus-props.js"></script>
<script src="app/scripts/menus/initials.js"></script>
<script src="app/scripts/menus/menus.js"></script>
<script src="app/scripts/sound.js"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment