auxiliar.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var timer, totalTime;
  2. // Initialize the game
  3. var game = new Phaser.Game(
  4. 900,
  5. 600,
  6. Phaser.CANVAS,
  7. 'fractions-game'
  8. );
  9. hip = "143.107.45.11"; //Host ip
  10. name = ""; //player name
  11. lang = ""; //language
  12. // Game One : kid and truck
  13. onePosition = 0; //Map position
  14. oneMove = false; //Move to next position
  15. oneDifficulty = 0; //From one to five
  16. oneOperator= ""; //Plus; Minus; Mixed
  17. oneLabel= false; //Show block label
  18. oneShape = ""; //Circle; square
  19. oneType = ""; // A - Place distance; B - Select blocks
  20. oneMenu = true;
  21. // Game Two : fractions association
  22. twoPosition = 0; //Map position
  23. twoMove = false; //Move to next position
  24. twoDifficulty = 0; //From one to five
  25. twoOperator= ""; //Plus; Minus; Mixed
  26. twoLabel= false; //Show block label
  27. twoShape = ""; //Circle; square
  28. twoType = ""; // A - Normal position; B - Random position
  29. twoMenu= true;
  30. //adding game states (scenes)
  31. game.state.add('boot', bootState); // boot.js
  32. game.state.add('load', loadState); // boot.js
  33. game.state.add('name', nameState); // boot.js
  34. game.state.add('menu', menuState); // menu.js
  35. game.state.add('menuCOne', menuCircleOne); // circleOne.js
  36. game.state.add('mapCOne', mapCircleOne); // circleOne.js
  37. game.state.add('gameCOne', gameCircleOne); // circleOne.js
  38. game.state.add('endCOne', endCircleOne); // circleOne.js
  39. game.state.add('menuSOne', menuSquareOne); // squareOne.js
  40. game.state.add('mapSOne', mapSquareOne); // squareOne.js
  41. game.state.add('gameSOne', gameSquareOne); // squareOne.js
  42. game.state.add('endSOne', endSquareOne); // squareOne.js
  43. game.state.add('menuSTwo', menuSquareTwo); // squareTwo.js
  44. game.state.add('mapSTwo', mapSquareTwo); // squareTwo.js
  45. game.state.add('gameSTwo', gameSquareTwo); // squareTwo.js
  46. game.state.add('endSTwo', endSquareTwo); // squareTwo.js
  47. //starting to boot game
  48. game.state.start('boot');