Browse Source

Initial commit

Igor 5 years ago
commit
d8571dd278
100 changed files with 135395 additions and 0 deletions
  1. 587 0
      css/bootstrap-theme.css
  2. 1 0
      css/bootstrap-theme.css.map
  3. 6 0
      css/bootstrap-theme.min.css
  4. 1 0
      css/bootstrap-theme.min.css.map
  5. 6760 0
      css/bootstrap.css
  6. 1 0
      css/bootstrap.css.map
  7. 6 0
      css/bootstrap.min.css
  8. 1 0
      css/bootstrap.min.css.map
  9. 1311 0
      css/jquery-ui.css
  10. 1 0
      css/jquery.modal.min.css
  11. 187 0
      eindex.php
  12. BIN
      fonts/glyphicons-halflings-regular.eot
  13. 288 0
      fonts/glyphicons-halflings-regular.svg
  14. BIN
      fonts/glyphicons-halflings-regular.ttf
  15. BIN
      fonts/glyphicons-halflings-regular.woff
  16. BIN
      fonts/glyphicons-halflings-regular.woff2
  17. 748 0
      index.html
  18. 277 0
      js/boot.js
  19. 1100 0
      js/circleOne.js
  20. 18706 0
      js/jquery-ui.js
  21. 5 0
      js/jquery.js
  22. 4 0
      js/jquery.min.js
  23. 5 0
      js/jquery.modal.min.js
  24. 229 0
      js/menu.js
  25. 103065 0
      js/phaser.js
  26. 28 0
      js/phaser.min.js
  27. 1072 0
      js/squareOne.js
  28. 943 0
      js/squareTwo.js
  29. 63 0
      resource/cn/save.php
  30. BIN
      resource/fx/beep.mp3
  31. BIN
      resource/fx/beep.ogg
  32. BIN
      resource/fx/error.mp3
  33. BIN
      resource/fx/error.ogg
  34. BIN
      resource/fx/ok.mp3
  35. BIN
      resource/fx/ok.ogg
  36. BIN
      resource/img/en_US/airballoon_base.png
  37. BIN
      resource/img/en_US/airballoon_upper.png
  38. BIN
      resource/img/en_US/birch.png
  39. BIN
      resource/img/en_US/farm.png
  40. BIN
      resource/img/en_US/flag.png
  41. BIN
      resource/img/en_US/garage.png
  42. BIN
      resource/img/en_US/house.png
  43. BIN
      resource/img/en_US/kid/lost.png
  44. BIN
      resource/img/en_US/kid/run.png
  45. BIN
      resource/img/en_US/kid/walk.png
  46. BIN
      resource/img/en_US/place_a.png
  47. BIN
      resource/img/en_US/place_b.png
  48. BIN
      resource/img/en_US/rock.png
  49. BIN
      resource/img/en_US/school.png
  50. BIN
      resource/img/en_US/sign.png
  51. BIN
      resource/img/en_US/tractor/frame-0.png
  52. BIN
      resource/img/en_US/tractor/frame-1.png
  53. BIN
      resource/img/en_US/tractor/frame-2.png
  54. BIN
      resource/img/en_US/tractor/frame-3.png
  55. BIN
      resource/img/en_US/tractor/frame-4.png
  56. BIN
      resource/img/en_US/tractor/frame-5.png
  57. BIN
      resource/img/en_US/tractor/frame-6.png
  58. BIN
      resource/img/en_US/tractor/frame-7.png
  59. BIN
      resource/img/en_US/tractor/frame-8.png
  60. BIN
      resource/img/en_US/tractor/frame-9.png
  61. BIN
      resource/img/en_US/tractor/frame.png
  62. BIN
      resource/img/en_US/tree.png
  63. BIN
      resource/img/en_US/tree2.png
  64. BIN
      resource/img/en_US/tree3.png
  65. BIN
      resource/img/en_US/tree4.png
  66. BIN
      resource/img/es_PE/airballoon_base.png
  67. BIN
      resource/img/es_PE/airballoon_upper.png
  68. BIN
      resource/img/es_PE/birch.png
  69. BIN
      resource/img/es_PE/farm.png
  70. BIN
      resource/img/es_PE/flag.png
  71. BIN
      resource/img/es_PE/garage.png
  72. BIN
      resource/img/es_PE/house.png
  73. BIN
      resource/img/es_PE/kid/lost.png
  74. BIN
      resource/img/es_PE/kid/run.png
  75. BIN
      resource/img/es_PE/kid/walk.png
  76. BIN
      resource/img/es_PE/place_a.png
  77. BIN
      resource/img/es_PE/place_b.png
  78. BIN
      resource/img/es_PE/rock.png
  79. BIN
      resource/img/es_PE/school.png
  80. BIN
      resource/img/es_PE/sign.png
  81. BIN
      resource/img/es_PE/tractor/frame-0.png
  82. BIN
      resource/img/es_PE/tractor/frame-1.png
  83. BIN
      resource/img/es_PE/tractor/frame-2.png
  84. BIN
      resource/img/es_PE/tractor/frame-3.png
  85. BIN
      resource/img/es_PE/tractor/frame-4.png
  86. BIN
      resource/img/es_PE/tractor/frame-5.png
  87. BIN
      resource/img/es_PE/tractor/frame-6.png
  88. BIN
      resource/img/es_PE/tractor/frame-7.png
  89. BIN
      resource/img/es_PE/tractor/frame-8.png
  90. BIN
      resource/img/es_PE/tractor/frame-9.png
  91. BIN
      resource/img/es_PE/tractor/frame.png
  92. BIN
      resource/img/es_PE/tree.png
  93. BIN
      resource/img/es_PE/tree2.png
  94. BIN
      resource/img/es_PE/tree3.png
  95. BIN
      resource/img/es_PE/tree4.png
  96. BIN
      resource/img/flag/BRAZ.jpg
  97. BIN
      resource/img/flag/FRAN.jpg
  98. BIN
      resource/img/flag/PERU.jpg
  99. BIN
      resource/img/flag/UNST.jpg
  100. 0 0
      resource/img/fr_FR/airballoon_base.png

+ 587 - 0
css/bootstrap-theme.css

@@ -0,0 +1,587 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+.btn-default,
+.btn-primary,
+.btn-success,
+.btn-info,
+.btn-warning,
+.btn-danger {
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
+}
+.btn-default:active,
+.btn-primary:active,
+.btn-success:active,
+.btn-info:active,
+.btn-warning:active,
+.btn-danger:active,
+.btn-default.active,
+.btn-primary.active,
+.btn-success.active,
+.btn-info.active,
+.btn-warning.active,
+.btn-danger.active {
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+}
+.btn-default.disabled,
+.btn-primary.disabled,
+.btn-success.disabled,
+.btn-info.disabled,
+.btn-warning.disabled,
+.btn-danger.disabled,
+.btn-default[disabled],
+.btn-primary[disabled],
+.btn-success[disabled],
+.btn-info[disabled],
+.btn-warning[disabled],
+.btn-danger[disabled],
+fieldset[disabled] .btn-default,
+fieldset[disabled] .btn-primary,
+fieldset[disabled] .btn-success,
+fieldset[disabled] .btn-info,
+fieldset[disabled] .btn-warning,
+fieldset[disabled] .btn-danger {
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+.btn-default .badge,
+.btn-primary .badge,
+.btn-success .badge,
+.btn-info .badge,
+.btn-warning .badge,
+.btn-danger .badge {
+  text-shadow: none;
+}
+.btn:active,
+.btn.active {
+  background-image: none;
+}
+.btn-default {
+  text-shadow: 0 1px 0 #fff;
+  background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
+  background-image:      -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
+  background-image:         linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #dbdbdb;
+  border-color: #ccc;
+}
+.btn-default:hover,
+.btn-default:focus {
+  background-color: #e0e0e0;
+  background-position: 0 -15px;
+}
+.btn-default:active,
+.btn-default.active {
+  background-color: #e0e0e0;
+  border-color: #dbdbdb;
+}
+.btn-default.disabled,
+.btn-default[disabled],
+fieldset[disabled] .btn-default,
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled.focus,
+.btn-default[disabled].focus,
+fieldset[disabled] .btn-default.focus,
+.btn-default.disabled:active,
+.btn-default[disabled]:active,
+fieldset[disabled] .btn-default:active,
+.btn-default.disabled.active,
+.btn-default[disabled].active,
+fieldset[disabled] .btn-default.active {
+  background-color: #e0e0e0;
+  background-image: none;
+}
+.btn-primary {
+  background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
+  background-image:      -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
+  background-image:         linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #245580;
+}
+.btn-primary:hover,
+.btn-primary:focus {
+  background-color: #265a88;
+  background-position: 0 -15px;
+}
+.btn-primary:active,
+.btn-primary.active {
+  background-color: #265a88;
+  border-color: #245580;
+}
+.btn-primary.disabled,
+.btn-primary[disabled],
+fieldset[disabled] .btn-primary,
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled.focus,
+.btn-primary[disabled].focus,
+fieldset[disabled] .btn-primary.focus,
+.btn-primary.disabled:active,
+.btn-primary[disabled]:active,
+fieldset[disabled] .btn-primary:active,
+.btn-primary.disabled.active,
+.btn-primary[disabled].active,
+fieldset[disabled] .btn-primary.active {
+  background-color: #265a88;
+  background-image: none;
+}
+.btn-success {
+  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
+  background-image:      -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
+  background-image:         linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #3e8f3e;
+}
+.btn-success:hover,
+.btn-success:focus {
+  background-color: #419641;
+  background-position: 0 -15px;
+}
+.btn-success:active,
+.btn-success.active {
+  background-color: #419641;
+  border-color: #3e8f3e;
+}
+.btn-success.disabled,
+.btn-success[disabled],
+fieldset[disabled] .btn-success,
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled.focus,
+.btn-success[disabled].focus,
+fieldset[disabled] .btn-success.focus,
+.btn-success.disabled:active,
+.btn-success[disabled]:active,
+fieldset[disabled] .btn-success:active,
+.btn-success.disabled.active,
+.btn-success[disabled].active,
+fieldset[disabled] .btn-success.active {
+  background-color: #419641;
+  background-image: none;
+}
+.btn-info {
+  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
+  background-image:      -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
+  background-image:         linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #28a4c9;
+}
+.btn-info:hover,
+.btn-info:focus {
+  background-color: #2aabd2;
+  background-position: 0 -15px;
+}
+.btn-info:active,
+.btn-info.active {
+  background-color: #2aabd2;
+  border-color: #28a4c9;
+}
+.btn-info.disabled,
+.btn-info[disabled],
+fieldset[disabled] .btn-info,
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled.focus,
+.btn-info[disabled].focus,
+fieldset[disabled] .btn-info.focus,
+.btn-info.disabled:active,
+.btn-info[disabled]:active,
+fieldset[disabled] .btn-info:active,
+.btn-info.disabled.active,
+.btn-info[disabled].active,
+fieldset[disabled] .btn-info.active {
+  background-color: #2aabd2;
+  background-image: none;
+}
+.btn-warning {
+  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
+  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
+  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #e38d13;
+}
+.btn-warning:hover,
+.btn-warning:focus {
+  background-color: #eb9316;
+  background-position: 0 -15px;
+}
+.btn-warning:active,
+.btn-warning.active {
+  background-color: #eb9316;
+  border-color: #e38d13;
+}
+.btn-warning.disabled,
+.btn-warning[disabled],
+fieldset[disabled] .btn-warning,
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled.focus,
+.btn-warning[disabled].focus,
+fieldset[disabled] .btn-warning.focus,
+.btn-warning.disabled:active,
+.btn-warning[disabled]:active,
+fieldset[disabled] .btn-warning:active,
+.btn-warning.disabled.active,
+.btn-warning[disabled].active,
+fieldset[disabled] .btn-warning.active {
+  background-color: #eb9316;
+  background-image: none;
+}
+.btn-danger {
+  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
+  background-image:      -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
+  background-image:         linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #b92c28;
+}
+.btn-danger:hover,
+.btn-danger:focus {
+  background-color: #c12e2a;
+  background-position: 0 -15px;
+}
+.btn-danger:active,
+.btn-danger.active {
+  background-color: #c12e2a;
+  border-color: #b92c28;
+}
+.btn-danger.disabled,
+.btn-danger[disabled],
+fieldset[disabled] .btn-danger,
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled.focus,
+.btn-danger[disabled].focus,
+fieldset[disabled] .btn-danger.focus,
+.btn-danger.disabled:active,
+.btn-danger[disabled]:active,
+fieldset[disabled] .btn-danger:active,
+.btn-danger.disabled.active,
+.btn-danger[disabled].active,
+fieldset[disabled] .btn-danger.active {
+  background-color: #c12e2a;
+  background-image: none;
+}
+.thumbnail,
+.img-thumbnail {
+  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+}
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+  background-color: #e8e8e8;
+  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
+  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
+  background-repeat: repeat-x;
+}
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
+  background-color: #2e6da4;
+  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+  background-image:      -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
+  background-image:         linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
+  background-repeat: repeat-x;
+}
+.navbar-default {
+  background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%);
+  background-image:      -o-linear-gradient(top, #fff 0%, #f8f8f8 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8));
+  background-image:         linear-gradient(to bottom, #fff 0%, #f8f8f8 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
+}
+.navbar-default .navbar-nav > .open > a,
+.navbar-default .navbar-nav > .active > a {
+  background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
+  background-image:      -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
+  background-image:         linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
+  background-repeat: repeat-x;
+  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
+}
+.navbar-brand,
+.navbar-nav > li > a {
+  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
+}
+.navbar-inverse {
+  background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);
+  background-image:      -o-linear-gradient(top, #3c3c3c 0%, #222 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222));
+  background-image:         linear-gradient(to bottom, #3c3c3c 0%, #222 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-radius: 4px;
+}
+.navbar-inverse .navbar-nav > .open > a,
+.navbar-inverse .navbar-nav > .active > a {
+  background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);
+  background-image:      -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f));
+  background-image:         linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
+  background-repeat: repeat-x;
+  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
+          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
+}
+.navbar-inverse .navbar-brand,
+.navbar-inverse .navbar-nav > li > a {
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
+}
+.navbar-static-top,
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+  border-radius: 0;
+}
+@media (max-width: 767px) {
+  .navbar .navbar-nav .open .dropdown-menu > .active > a,
+  .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
+  .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
+    color: #fff;
+    background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+    background-image:      -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+    background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
+    background-image:         linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
+    background-repeat: repeat-x;
+  }
+}
+.alert {
+  text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
+}
+.alert-success {
+  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
+  background-image:      -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc));
+  background-image:         linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #b2dba1;
+}
+.alert-info {
+  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
+  background-image:      -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0));
+  background-image:         linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #9acfea;
+}
+.alert-warning {
+  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
+  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0));
+  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #f5e79e;
+}
+.alert-danger {
+  background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
+  background-image:      -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3));
+  background-image:         linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #dca7a7;
+}
+.progress {
+  background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
+  background-image:      -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5));
+  background-image:         linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar {
+  background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);
+  background-image:      -o-linear-gradient(top, #337ab7 0%, #286090 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090));
+  background-image:         linear-gradient(to bottom, #337ab7 0%, #286090 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-success {
+  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
+  background-image:      -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
+  background-image:         linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-info {
+  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
+  background-image:      -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5));
+  background-image:         linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-warning {
+  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
+  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f));
+  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-danger {
+  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
+  background-image:      -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c));
+  background-image:         linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-striped {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+}
+.list-group {
+  border-radius: 4px;
+  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+}
+.list-group-item.active,
+.list-group-item.active:hover,
+.list-group-item.active:focus {
+  text-shadow: 0 -1px 0 #286090;
+  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);
+  background-image:      -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a));
+  background-image:         linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #2b669a;
+}
+.list-group-item.active .badge,
+.list-group-item.active:hover .badge,
+.list-group-item.active:focus .badge {
+  text-shadow: none;
+}
+.panel {
+  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
+          box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
+}
+.panel-default > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
+  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-primary > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+  background-image:      -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
+  background-image:         linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-success > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
+  background-image:      -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6));
+  background-image:         linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-info > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
+  background-image:      -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3));
+  background-image:         linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-warning > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
+  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc));
+  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-danger > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
+  background-image:      -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc));
+  background-image:         linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
+  background-repeat: repeat-x;
+}
+.well {
+  background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
+  background-image:      -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5));
+  background-image:         linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #dcdcdc;
+  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
+          box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
+}
+/*# sourceMappingURL=bootstrap-theme.css.map */

File diff suppressed because it is too large
+ 1 - 0
css/bootstrap-theme.css.map


File diff suppressed because it is too large
+ 6 - 0
css/bootstrap-theme.min.css


File diff suppressed because it is too large
+ 1 - 0
css/bootstrap-theme.min.css.map


File diff suppressed because it is too large
+ 6760 - 0
css/bootstrap.css


File diff suppressed because it is too large
+ 1 - 0
css/bootstrap.css.map


File diff suppressed because it is too large
+ 6 - 0
css/bootstrap.min.css


File diff suppressed because it is too large
+ 1 - 0
css/bootstrap.min.css.map


File diff suppressed because it is too large
+ 1311 - 0
css/jquery-ui.css


File diff suppressed because it is too large
+ 1 - 0
css/jquery.modal.min.css


+ 187 - 0
eindex.php

@@ -0,0 +1,187 @@
+<!DOCTYPE html>  
+<html>
+    <head>  
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+        <title> Fractions </title>
+        <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
+        <script type="text/javascript" src="js/phaser.min.js"></script>
+        <script type="text/javascript" src="js/boot.js"></script>
+        <script type="text/javascript" src="js/menu.js"></script>
+        <script type="text/javascript" src="js/circleOne.js"></script>
+        <script type="text/javascript" src="js/squareOne.js"></script>
+        <script type="text/javascript" src="js/squareTwo.js"></script>
+    </head>
+
+    <body>
+
+    <div class="container">
+    	<div class="clearfix"></div>
+        <div class="panel panel-primary">
+          <div class="panel-heading">FRACTIONS GAME</div>
+          <div class="panel-body">
+            <center>
+                <div id="fractions-game" style="padding: 0 auto 0 auto;"></div>
+            </center>
+          </div>
+        </div>
+        <div class="panel panel-info">
+          <div class="panel-heading">COOPERATION TEAM</div>
+          <div class="panel-body">
+            <center>
+                <ul>
+                  <li><strong>BRAZIL:</strong> Le&ocirc;nidas de Oliveira Brand&atilde;o (IME-USP)</li>
+                  <li><strong>PERU:</strong> Manuel Ibarra and Cristhian Serrano (EAPIIS-UNAMBA)</li>
+                  <li><strong>FRANCE:</strong> Jean-Marc (MOCAH-UPMC)</li>
+                </ul>
+            </center>
+          </div>
+        </div>
+        <div class="panel panel-default">
+          <div class="panel-heading">BASED ON</div>
+          <div class="panel-body">
+            <center>
+                <ul>
+                  <li><strong>iLM </strong>(interactive Learning Modules) </li>
+                  <li><strong>Six facets of Serious Game Design</strong>:<br>
+Pedagogical Objectives; Domain Simulation; Interactions with the Simulation; Problems and Progression; Decorum and Conditions of Use.
+</li>
+                </ul>
+            </center>
+          </div>
+        </div>
+        <div class="panel panel-danger">
+          <div class="panel-heading">TECHNOLOGY</div>
+          <div class="panel-body">
+            <center>
+                <ul>
+                  <li> We used <strong>HTML5</strong>, <strong>CSS</strong> and the <strong>Javascript</strong> Library <a href="http://phaser.io/" target="_blank"><strong>Phaser.io</strong></a> </li>
+                </ul>
+            </center>
+          </div>
+        </div>
+    </div>
+        
+    </body>
+
+    
+    <?php /* retrieving parameters */ 
+        
+    $do = $_REQUEST['do'];
+    $lang = $_REQUEST['language'];
+    $shape = $_REQUEST['shape'];
+    $type = $_REQUEST['mode'];
+    $posit = 0;
+    $opera = $_REQUEST['operator'];
+    $diffi = $_REQUEST['difficulty'];
+    $label = $_REQUEST['label'];
+
+    //?do=play&language=es_PE&shape=Circle&mode=A&operator=Plus&difficulty=1&label=true
+    
+    if(!isset($do)){
+    ?>
+    
+    <script type="text/javascript">
+        // Initialize the game
+        var game = new Phaser.Game(900, 600, Phaser.CANVAS, 'fractions-game');
+        
+        hip = "<?=$_SERVER['REMOTE_ADDR']?>"; //Host ip
+        name = ""; //player name
+        lang = ""; //language
+        var timer, totalTime;
+            // Game One 
+         onePosition = 0; //Map position
+         oneMove = false; //Move to next position
+         oneDifficulty = 0; //From one to five 
+         oneOperator= ""; //Plus; Minus; Mixed
+         oneLabel= false; //Show block label
+         oneShape = ""; //Circle; square
+         oneType = ""; // A - Place distance; B - Select blocks
+         oneMenu = true;
+            // Game Two
+         twoPosition = 0; //Map position
+         twoMove = false; //Move to next position
+         twoDifficulty = 0; //From one to five 
+         twoOperator= ""; //Plus; Minus; Mixed
+         twoLabel= false; //Show block label
+         twoShape = ""; //Circle; square
+         twoType = ""; // A - Normal position; B - Random position
+         twoMenu= true;
+        
+        //adding game states (scenes)
+        game.state.add('boot', bootState);  
+        game.state.add('load', loadState); 
+        game.state.add('name', nameState);
+        game.state.add('menu', menuState);  
+        
+        game.state.add('menuCOne', menuCircleOne);
+        game.state.add('mapCOne', mapCircleOne);
+        game.state.add('gameCOne', gameCircleOne);
+        game.state.add('endCOne', endCircleOne);
+                
+        game.state.add('menuSOne', menuSquareOne);
+        game.state.add('mapSOne', mapSquareOne);
+        game.state.add('gameSOne', gameSquareOne);
+        game.state.add('endSOne', endSquareOne);
+        
+        game.state.add('menuSTwo', menuSquareTwo);
+        game.state.add('mapSTwo', mapSquareTwo);
+        game.state.add('gameSTwo', gameSquareTwo);
+        game.state.add('endSTwo', endSquareTwo);
+        
+        //starting to boot game
+        game.state.start('boot');
+    </script>
+    <? } else if($do=="play"){ ?>
+    
+    <script type="text/javascript">
+        // Initialize the game
+        var game = new Phaser.Game(900, 600, Phaser.CANVAS, 'fractions-game');
+        
+        var hip = "<?=$_SERVER['REMOTE_ADDR']?>"; //Host ip
+        var name = "";
+        var lang = "<?=$lang?>";
+        var timer, totalTime;
+        
+        var onePosition = <?=$posit?>;
+        var oneMove = true;
+        var oneDifficulty = <?=$diffi?>;
+        var oneOperator = "<?=$opera?>";
+        var oneLabel = <?=$label?>;
+        var oneShape = "<?=$shape?>";
+        var oneType = "<?=$type?>";
+        var oneMenu = false;
+        
+        var twoPosition = 0; //Map position
+        var twoMove = false; //Move to next position
+        var twoDifficulty = 0; //From one to five 
+        var twoOperator= ""; //Plus; Minus; Mixed
+        var twoLabel= false; //Show block label
+        var twoShape = ""; //Circle; square
+        var twoType = ""; // A - Normal position; B - Random position
+        var twoMenu= true;
+        
+        //adding game states (scenes) 
+        game.state.add('boot', bootState); 
+        game.state.add('load', loadState); 
+        game.state.add('name', nameState);
+        
+        game.state.add('menuCOne', menuCircleOne);
+        game.state.add('mapCOne', mapCircleOne);
+        game.state.add('gameCOne', gameCircleOne);
+        game.state.add('endCOne', endCircleOne);
+                
+        game.state.add('menuSOne', menuSquareOne);
+        game.state.add('mapSOne', mapSquareOne);
+        game.state.add('gameSOne', gameSquareOne);
+        game.state.add('endSOne', endSquareOne);
+        
+        game.state.add('menuSTwo', menuSquareTwo);
+        game.state.add('mapSTwo', mapSquareTwo);
+        game.state.add('gameSTwo', gameSquareTwo);
+        game.state.add('endSTwo', endSquareTwo);
+        
+        //starting to load game
+        game.state.start('load');
+    </script>
+    <? } ?>
+</html>

BIN
fonts/glyphicons-halflings-regular.eot


File diff suppressed because it is too large
+ 288 - 0
fonts/glyphicons-halflings-regular.svg


BIN
fonts/glyphicons-halflings-regular.ttf


BIN
fonts/glyphicons-halflings-regular.woff


BIN
fonts/glyphicons-halflings-regular.woff2


+ 748 - 0
index.html

@@ -0,0 +1,748 @@
+<!DOCTYPE html>  
+<html>
+    <head>  
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+        <title> iFractions </title>
+        <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
+        <link rel="stylesheet" type="text/css"  href="css/jquery-ui.css">
+        <link rel="stylesheet" type="text/css"  href="css/jquery.modal.min.css">
+        <script type="text/javascript" src="js/phaser.min.js"></script>
+        <script type="text/javascript" src="js/jquery.js"></script>
+        <script type="text/javascript" src="js/jquery-ui.js"></script>
+        <script type="text/javascript" src="js/jquery.modal.min.js"></script>
+        <script type="text/javascript" src="js/boot.js"></script>
+        <script type="text/javascript" src="js/menu.js"></script>
+        <script type="text/javascript" src="js/circleOne.js"></script>
+        <script type="text/javascript" src="js/squareOne.js"></script>
+        <script type="text/javascript" src="js/squareTwo.js"></script>
+
+        <script>
+            function getParameterByName(name) {
+                var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
+                return match ? decodeURIComponent(match[1].replace(/\+/g, ' ')) : null;
+            }
+            function getAnswer() {
+                if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
+                    var str = "{"
+                            + '"shape": "' + jogo.shape
+                            + '", "modo": "' + jogo.modo
+                            + '", "label": "' + jogo.label
+                            + '", "operator": "' + jogo.operator
+                            + '", "difficulty": "' + jogo.difficulty
+                            + '", "num": "' + jogo.num
+                            + '", "results": {';
+                    for (j = 0; j < iterator; j++) {
+                        str += '"' + (j + 1) + '": { "phase": "' + (j + 1)
+                                + '", "hits": "' + hits[j]
+                                + '", "errors": "' + errors[j]
+                                + '", "start": "' + start[j]
+                                + '", "end": "' + end[j]
+                                + '" }' + ((j + 1 < iterator) ? "," : "");
+                    }
+                    str += "}}";
+                    return str;
+                } else {
+                    console.log("getAnswer:: called");
+                    if (modulo < 1) {
+                        alert(words.error_module);
+                        return x;
+                    }
+                    if (difficulty < 1) {
+                        alert(words.error_difficulty);
+                        return x;
+                    }
+                    if (num < 5) {
+                        return '{'
+                                + '"shape": "' + (modules_names[modulo].split(",")[0] === words.square_name ? "Square" : "Circle")
+                                + '", "modo": "' + modos[modulo]
+                                + '", "label": "' + labels[modulo]
+                                + '", "operator": "' + (operation == 1 ? "Plus" : (operation == 2 ? "Minus" : (operation == 3 ? "Mixed" : "Equals")))
+                                + '", "difficulty": "' + difficulty
+                                + '", "num": "' + num
+                                + '"}';
+                    } else {
+                        return '{'
+                                + '"shape": "' + (modules_names[modulo].split(",")[0] === words.square_name ? "Square" : "Circle")
+                                + '", "modo": "' + (operation == 1 ? "A" : (operation == 2 ? "B" : "C"))
+                                + '", "label": "' + labels[modulo]
+                                + '", "operator": "' + (operation == 1 ? "Plus" : (operation == 2 ? "Minus" : (operation == 3 ? "Mixed" : "Equals")))
+                                + '", "difficulty": "' + difficulty
+                                + '", "num": "' + num
+                                + '"}';
+                    }
+                }
+            }
+            function getEvaluation() {
+                console.log("getEvaluation:: called");
+                getEvaluationCallback(1); // verificar com o professor:: uma fórmula para compor a nota do aluno
+            }
+            function getEvaluationCallback(nota) {
+                console.log("getEvaluationCallback:: called");
+                if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
+                    parent.getEvaluationCallback(nota);
+                }
+            }
+            var iLMparameters = {
+                iLM_PARAM_ServerToGetAnswerURL: getParameterByName("iLM_PARAM_ServerToGetAnswerURL"),
+                iLM_PARAM_SendAnswer: getParameterByName("iLM_PARAM_SendAnswer"),
+                iLM_PARAM_AssignmentURL: getParameterByName("iLM_PARAM_AssignmentURL"),
+                iLM_PARAM_Assignment: getParameterByName("iLM_PARAM_Assignment"),
+                lang: getParameterByName("lang")
+            };
+            function trackAction(action) {
+                $.post(iLMparameters.iLM_PARAM_ServerToGetAnswerURL + "&track=1", {trackingData: "html=1;" + action}, function (d) {});
+            }
+        </script>
+        <style>
+            .input-hidden {
+                position: absolute;
+                left: -9999px;
+            }
+
+            input[type=radio]:checked + label>img {
+                border: 1px solid #fff;
+                box-shadow: 0 0 3px 3px #090;
+                filter: grayscale(0%);
+            }
+
+            input[type=radio] + label>img {
+                width: 80px;
+                height: 80px;
+                margin-left: 5px;
+                filter: grayscale(100%);
+                transition: 500ms all;
+            }
+            #form-create img:hover {
+                filter: grayscale(0%);
+            }
+            #select_module, #select_difficulty, #options_summary_title {
+                text-align: left;
+                padding: 15px;
+            }
+            #options_module, #options_diff {
+                text-align: left;
+                padding-left: 40px;
+            }
+            .img_difficulty {
+                width: 80px !important;
+                margin-right: 20px;
+                margin-top: 20px;
+            }
+            #results-title {
+                font-size: 140%;
+                border-bottom: 2px solid #c9d1dd;
+                padding-bottom: 5px;
+            }
+            #results-image, #results-info {
+                float: left;
+                margin-top: 10px;
+            }
+            #results-image img {
+                width: 80px;
+                height: 80px;
+            }
+            #results-info {
+                margin-left: 15px;
+                margin-top: 20px;
+                font-size: 120%;
+            }
+            #bl {
+                width: 100%; 
+                height: 105px;
+                border-bottom: 2px solid #c9d1dd;
+            }
+            .results-levels {
+                border-bottom: 2px solid #c9d1dd;
+                padding: 10px;
+            }
+            .results-levels img {
+                width: 60px;
+            }
+            .numphase {
+                float: left;
+                margin-top: -50px;
+                margin-left: 25px;
+                position: absolute;
+                z-index: 9999;
+                color: white;
+                font-size: 20px;
+                font-weight: bold;
+            }
+            .panel-body, .panel-primary {
+                padding: 0;
+                border: none;
+                height: auto;
+                width: auto;
+                margin: 0;
+            }
+            .results-levels-item {
+                margin-top: -70px;
+                margin-left: 75px;
+            }
+            .container {    
+                width: auto;
+                padding: 0;
+                margin: 0;
+            }
+            .close-modal {
+                margin: 10px;
+            }
+            .modal-title {
+                text-align: center;
+                font-size: 24px;
+                font-weight: bold;
+            }
+            .modal-geral {
+                font-size: 16px;
+                margin: 10px;
+            }
+            .modal-coop {
+                padding: 5px;
+                border: 1px solid #4286f4;
+                background-color: #c5d9f9;
+                border-radius: 10px 10px 0 0;
+                margin-top: 10px;
+                font-weight: bold;
+            }
+            .modal-coop-content {
+                border: 1px solid #4286f4;
+                margin-top: -1px;
+                padding: 5px;
+                border-radius: 0 0 10px 10px;
+            }
+            .modal-based {
+                padding: 5px;
+                border: 1px solid #ff5e5e;
+                background-color: #f9dbdb;
+                border-radius: 10px 10px 0 0;
+                margin-top: 10px;
+                font-weight: bold;
+            }
+            .modal-based-content {
+                border: 1px solid #ff5e5e;
+                margin-top: -1px;
+                padding: 5px;
+                border-radius: 0 0 10px 10px;
+            }
+            .modal-tech {
+                padding: 5px;
+                border: 1px solid #109b0d;
+                background-color: #b6ffb5;
+                border-radius: 10px 10px 0 0;
+                margin-top: 10px;
+                font-weight: bold;
+            }
+            .modal-tech-content {
+                border: 1px solid #109b0d;
+                margin-top: -1px;
+                padding: 5px;
+                border-radius: 0 0 10px 10px;
+            }
+            .results-levels:hover {
+                background: #f5f5f5;
+            }
+
+        </style>
+    </head>
+
+    <body>
+
+        <div class="container">
+            <div class="clearfix"></div>
+            <div class="panel panel-primary">
+                <!--<div class="panel-heading">FRACTIONS GAME</div>-->
+                <div class="panel-body">
+                    <center>
+                        <div id="fractions-game" style="padding: 0 auto 0 auto;">
+                            <div id="form-create" style="display: none;">
+                                <script>
+                                    // 
+                                    var words = [];
+                                    var modules_names = [''];
+                                    var total_levels = [0, 2, 2, 3, 3, 3, 2, 2, 3, 3];
+                                    var levels = [0, 3, 3, 5, 5, 5, 3, 3, 5, 5];
+                                    var modos = ['', 'A', 'A', 'A', 'A', 'C', 'B', 'B', 'B', 'B'];
+                                    var labels = [false, true, false, true, false, false, true, false, true, false];
+                                    var operation_img = [''];
+                                    var operation;
+                                    var difficulty = 0;
+                                    var modulo = 0;
+                                    var num;
+                                    var redir = true;
+
+                                    var url_lang;
+                                    if (iLMparameters.lang == "en")
+                                        url_lang = "en_US";
+                                    if (iLMparameters.lang == "pt")
+                                        url_lang = "pt_BR";
+                                    if (iLMparameters.lang == "fr")
+                                        url_lang = "fr_FR";
+                                    if (iLMparameters.lang == "es")
+                                        url_lang = "es_PE";
+
+                                    $.getJSON("resource/lang/" + url_lang + ".json", function (data) {
+                                        $.each(data, function (key, val) {
+                                            words[key] = val;
+                                        });
+                                        $("#select_module").html(words.select_module + ":");
+                                        $("#select_difficulty").html(words.select_operation + ":");
+                                        $("#options_summary_title").html(words.options_summary + ":");
+                                        $("#options_module").html(words.options_module + ":");
+                                        $("#options_diff").html(words.options_difficulty + ":");
+
+                                        modules_names[1] = words.square_name + ", " + words.mode_name + " A, " + words.with_name + " " + words.label_name;
+                                        modules_names[2] = words.square_name + ", " + words.mode_name + " A, " + words.without_name + " " + words.label_name;
+                                        modules_names[3] = words.circle_name + ", " + words.mode_name + " A, " + words.with_name + " " + words.label_name;
+                                        modules_names[4] = words.circle_name + ", " + words.mode_name + " A, " + words.without_name + " " + words.label_name;
+                                        modules_names[5] = words.square_name + ", " + words.mode_name + " C, " + words.without_name + " " + words.label_name;
+                                        modules_names[6] = words.square_name + ", " + words.mode_name + " B, " + words.with_name + " " + words.label_name;
+                                        modules_names[7] = words.square_name + ", " + words.mode_name + " B, " + words.without_name + " " + words.label_name;
+                                        modules_names[8] = words.circle_name + ", " + words.mode_name + " B, " + words.with_name + " " + words.label_name;
+                                        modules_names[9] = words.circle_name + ", " + words.mode_name + " B, " + words.without_name + " " + words.label_name;
+
+                                        for (i = 1; i < modules_names.length; i++) {
+                                            $("#img_" + i).attr("title", modules_names[i]);
+                                        }
+
+                                        operation_img[1] = "help/arrow.png,help/arrow_2.png";
+                                        operation_img[2] = "help/arrow.png,help/arrow_2.png";
+                                        operation_img[3] = "help/arrow.png,help/arrow_2.png,help/double.png";
+                                        operation_img[4] = "help/arrow.png,help/arrow_2.png,help/double.png";
+                                        operation_img[5] = ",operator/equal.png,";
+                                        operation_img[6] = "help/arrow.png,help/arrow_2.png";
+                                        operation_img[7] = "help/arrow.png,help/arrow_2.png";
+                                        operation_img[8] = "help/arrow.png,help/arrow_2.png,help/double.png";
+                                        operation_img[9] = "help/arrow.png,help/arrow_2.png,help/double.png";
+
+                                    });
+
+                                    $(function () {
+                                        $(document).tooltip();
+                                    });
+
+                                    function show_operation_and_difficulty(opt) {
+
+                                        difficulty = 0;
+                                        $("#div_difficulty").css("display", "block");
+                                        $("#div_summary").css("display", "none");
+                                        $("#options_module").html(words.options_module + ":");
+                                        $("#options_diff").html(words.options_difficulty + ":");
+
+                                        modulo = parseInt(opt.value);
+                                        num = (modulo == 1 ? 1 : (modulo == 2 ? 2 : (modulo == 3 ? 1 : (modulo == 4 ? 2 : (modulo == 5 ? 5 : (modulo == 6 ? 3 : (modulo == 7 ? 4 : (modulo == 8 ? 3 : 4))))))));
+                                        var i;
+                                        var divs = "";
+                                        var id = 1;
+                                        for (i = 0; i < total_levels[modulo]; i++) {
+                                            var j;
+                                            divs += "<div style='margin-bottom: 20px;'>";
+                                            if (operation_img[modulo].split(",")[i] !== '') {
+                                                divs += "<img class='img_difficulty' src='resource/img/global/" + operation_img[modulo].split(",")[i] + "'>";
+                                            } else {
+                                                divs += "<div class='img_difficulty' style='display:inline;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>";
+                                            }
+
+                                            for (j = 0; j < levels[modulo]; j++) {
+                                                divs += "<input type='radio' name='difficulty' id='diff_" + id + "' class='input-hidden' value='" + i + "," + j + "' onchange='change_operation_and_difficulty(" + (i + 1) + "," + (j + 1) + ")' /> <label for='diff_" + id + "'> <img src='resource/img/global/dot.png' style='height: " + ((j + 1) * 20) + "px; width: 30px; margin-bottom: -" + (((levels[modulo] + 1) * 20) - ((j + 1) * 20)) + "px;' /> </label>";
+                                                id++;
+                                            }
+                                            divs += "</div>";
+                                        }
+                                        $("#options_difficulty").html(divs);
+                                        $("#options_module").html(words.options_module + ": " + modules_names[modulo]);
+                                    }
+
+                                    function change_operation_and_difficulty(op, dif) {
+                                        $("#div_summary").css("display", "block");
+                                        operation = parseInt(op);
+                                        difficulty = parseInt(dif);
+                                        var op_text = "";
+                                        switch (operation) {
+                                            case 1:
+                                                op_text = words.options_plus;
+                                                break;
+                                            case 2:
+                                                op_text = words.options_minus;
+                                                break;
+                                            case 3:
+                                                op_text = words.options_mixed;
+                                                break;
+                                            case 4:
+                                                op_text = words.options_equals;
+                                                break;
+                                        }
+                                        $("#options_diff").html(words.options_difficulty + ": " + op_text + ", " + difficulty);
+                                    }
+
+                                </script>
+
+                                <div id="select_module"></div>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in1" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="1" />
+                                <label for="in1">
+                                    <img id="img_1" src="resource/img/global/game/one-s.png" title=""  />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in2" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="2" />
+                                <label for="in2">
+                                    <img id="img_2" src="resource/img/global/game/two-s.png" title="" />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in3" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="3" />
+                                <label for="in3">
+                                    <img id="img_3" src="resource/img/global/game/one-c.png" title="" />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in4" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="4" />
+                                <label for="in4">
+                                    <img id="img_4" src="resource/img/global/game/two-c.png" title="" />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in5" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="5" />
+                                <label for="in5">
+                                    <img id="img_5" src="resource/img/global/game/five-s.png" title="" />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in6" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="6" />
+                                <label for="in6">
+                                    <img id="img_6" src="resource/img/global/game/three-s.png" title="" />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in7" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="7" />
+                                <label for="in7">
+                                    <img id="img_7" src="resource/img/global/game/four-s.png" title="" />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in8" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="8" />
+                                <label for="in8">
+                                    <img id="img_8" src="resource/img/global/game/three-c.png" title="" />
+                                </label>
+
+                                <input 
+                                    type="radio" name="emotion"
+                                    id="in9" class="input-hidden" onchange="show_operation_and_difficulty(this)" value="9" />
+                                <label for="in9">
+                                    <img id="img_9" src="resource/img/global/game/four-c.png" title="" />
+                                </label>
+
+                                <div id="div_difficulty" style="display:none;">
+                                    <div id="select_difficulty"></div>
+                                    <div id="options_difficulty"></div>
+                                </div>
+
+                                <div id="div_summary" style="display:none;">
+                                    <div id="options_summary_title"></div>
+                                    <div id="options_summary_text">
+                                        <div id="options_module"></div>
+                                        <div id="options_diff"></div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </center>
+
+                    <div id="results" style="display: none;">
+                        <div id="results-title"></div>
+                        <div id="bl">
+                            <div id="results-image"></div>
+                            <div id="results-info"></div>
+                        </div>
+                        <div id="results-details"></div>
+                    </div>
+                </div>
+            </div>
+            <!--
+            <div class="panel panel-info">
+                <div class="panel-heading">COOPERATION TEAM</div>
+                <div class="panel-body">
+                    <center>
+                        <ul>
+                            <li><strong>BRAZIL:</strong> Le&ocirc;nidas de Oliveira Brand&atilde;o (IME-USP)</li>
+                            <li><strong>PERU:</strong> Manuel Ibarra and Cristhian Serrano (EAPIIS-UNAMBA)</li>
+                            <li><strong>FRANCE:</strong> Jean-Marc (MOCAH-UPMC)</li>
+                        </ul>
+                    </center>
+                </div>
+            </div>
+            <div class="panel panel-default">
+                <div class="panel-heading">BASED ON</div>
+                <div class="panel-body">
+                    <center>
+                        <ul>
+                            <li><strong>iLM </strong>(interactive Learning Modules) </li>
+                            <li><strong>Six facets of Serious Game Design</strong>:<br>
+                                Pedagogical Objectives; Domain Simulation; Interactions with the Simulation; Problems and Progression; Decorum and Conditions of Use.
+                            </li>
+                        </ul>
+                    </center>
+                </div>
+            </div>
+            <div class="panel panel-danger">
+                <div class="panel-heading">TECHNOLOGY</div>
+                <div class="panel-body">
+                    <center>
+                        <ul>
+                            <li> We used <strong>HTML5</strong>, <strong>CSS</strong> and the <strong>Javascript</strong> Library <a href="http://phaser.io/" target="_blank"><strong>Phaser.io</strong></a> </li>
+                        </ul>
+                    </center>
+                </div>
+            </div>
+            -->
+        </div>
+
+    </body>
+
+
+
+    <script type="text/javascript">
+        // If SendAnswer (student) ::Igor
+        if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
+            // Initialize the game
+            var game = new Phaser.Game(900, 600, Phaser.CANVAS, 'fractions-game');
+            hip = "143.107.45.11"; //Host ip
+            /*name = ""; //player name*/
+            lang = ""; //language
+            var timer, totalTime;
+            // Game One 
+            onePosition = 0; //Map position
+            oneMove = false; //Move to next position
+            oneDifficulty = 0; //From one to five 
+            oneOperator = ""; //Plus; Minus; Mixed
+            oneLabel = false; //Show block label
+            oneShape = ""; //Circle; square
+            oneType = ""; // A - Place distance; B - Select blocks
+            oneMenu = true;
+            // Game Two
+            twoPosition = 0; //Map position
+            twoMove = false; //Move to next position
+            twoDifficulty = 0; //From one to five 
+            twoOperator = ""; //Plus; Minus; Mixed
+            twoLabel = false; //Show block label
+            twoShape = ""; //Circle; square
+            twoType = ""; // A - Normal position; B - Random position
+            twoMenu = true;
+            //adding game states (scenes)
+            game.state.add('boot', bootState);
+            game.state.add('load', loadState);
+            game.state.add('name', nameState);
+            game.state.add('menu', menuState);
+            game.state.add('menuCOne', menuCircleOne);
+            game.state.add('mapCOne', mapCircleOne);
+            game.state.add('gameCOne', gameCircleOne);
+            game.state.add('endCOne', endCircleOne);
+            game.state.add('menuSOne', menuSquareOne);
+            game.state.add('mapSOne', mapSquareOne);
+            game.state.add('gameSOne', gameSquareOne);
+            game.state.add('endSOne', endSquareOne);
+            game.state.add('menuSTwo', menuSquareTwo);
+            game.state.add('mapSTwo', mapSquareTwo);
+            game.state.add('gameSTwo', gameSquareTwo);
+            game.state.add('endSTwo', endSquareTwo);
+
+            lang = url_lang;
+
+            var jogo = [];
+            $.get(iLMparameters.iLM_PARAM_Assignment, function (d) {
+                if (d != null) {
+                    $.each(d, function (key, val) {
+                        jogo[key] = val;
+                    });
+                    register_start();
+                    if (jogo.hasOwnProperty('results')) {
+                        $("#fractions-game").css("display", "none");
+                        $("#results").css("display", "block");
+
+                        var results = [];
+                        $.each(jogo.results, function (key, val) {
+                            results[key] = val;
+                        });
+
+                        $("#results-title").html(words.results_title);
+                        $("#results-info").html(words.results_operation + ": " + jogo.operator + "<br>" + words.results_difficulty + ": " + jogo.difficulty);
+
+                        var dd = "";
+                        for (i = 1; i < results.length; i++) {
+                            dd += "<div class='results-levels'> <img src='resource/img/en_US/sign.png'><div class='numphase'>" + i + "</div> ";
+
+                            dd += "<div class='results-levels-item'>" + words.results_start + ": " + timeConverter(results[i].start);
+                            dd += " " + words.results_end + ": " + timeConverter(results[i].end);
+
+                            errors[i - 1] = results[i].errors;
+                            hits[i - 1] = results[i].hits;
+                            start[i - 1] = results[i].start;
+                            end[i - 1] = results[i].end;
+                            iterator++;
+
+                            var temp = results[i].end - results[i].start;
+                            dd += "<br>" + words.results_time + ": " + ("" + temp + "").toHHMMSS();
+                            dd += "<br>" + words.results_hits + ": " + results[i].hits;
+                            dd += "<br>" + words.results_errors + ": " + results[i].errors;
+                            //dd += "<br>" + words.results_grade + ": ";
+                            dd += "</div></div>";
+                        }
+                        $("#results-details").html(dd);
+                        var icone = "";
+                        if (jogo.shape == "Square") {
+                            if (jogo.modo == "A") {
+                                if (jogo.label == true) {
+                                    icone = "one-s.png";
+                                } else {
+                                    icone = "two-s.png";
+                                }
+                            }
+                            if (jogo.modo == "B") {
+                                if (jogo.label == true) {
+                                    icone = "three-s.png";
+                                } else {
+                                    icone = "four-s.png";
+                                }
+                            }
+                            if (jogo.modo == "C") {
+                                icone = "five-s.png";
+                            }
+                        } else {
+                            if (jogo.modo == "A") {
+                                if (jogo.label == true) {
+                                    icone = "one-c.png";
+                                } else {
+                                    icone = "two-c.png";
+                                }
+                            }
+                            if (jogo.modo == "B") {
+                                if (jogo.label == true) {
+                                    icone = "three-c.png";
+                                } else {
+                                    icone = "four-c.png";
+                                }
+                            }
+                        }
+
+                        $("#results-image").html("<img src='resource/img/global/game/" + icone + "'>");
+
+                    } else {
+                        //starting to boot game
+                        game.state.start('boot');
+                    }
+                } else
+                    alert('Erro: nao consegui ler o conteudo de ' + iLMparameters.iLM_PARAM_Assignment);
+            }, "json");
+
+            var conta = true;
+            var iterator = 0;
+            var hits = [0, 0, 0, 0];
+            var errors = [0, 0, 0, 0];
+            var start = [0, 0, 0, 0];
+            var end = [0, 0, 0, 0];
+
+        } else { // If Not SendAnswer (teacher) ::Igor
+            $("#form-create").css("display", "block");
+        }
+
+        function sendResults(final) {
+            var str = "{"
+                    + '"shape": "' + jogo.shape
+                    + '", "modo": "' + jogo.modo
+                    + '", "label": "' + jogo.label
+                    + '", "operator": "' + jogo.operator
+                    + '", "difficulty": "' + jogo.difficulty
+                    + '", "num": "' + jogo.num
+                    + '", "results": {';
+            for (j = 0; j < iterator; j++) {
+                str += '"' + (j + 1) + '": { "phase": "' + (j + 1)
+                        + '", "hits": "' + hits[j]
+                        + '", "errors": "' + errors[j]
+                        + '", "start": "' + start[j]
+                        + '", "end": "' + end[j]
+                        + '" }' + ((j + 1 < iterator) ? "," : "");
+            }
+            str += "}}";
+            console.log(str);
+            $.post(iLMparameters.iLM_PARAM_ServerToGetAnswerURL, {return_get_answer: 1, iLM_PARAM_ActivityEvaluation: final, iLM_PARAM_ArchiveContent: str}, function (d) {});
+        }
+
+        function register_start() {
+            var str = "{"
+                    + '"shape": "' + jogo.shape
+                    + '", "modo": "' + jogo.modo
+                    + '", "label": "' + jogo.label
+                    + '", "operator": "' + jogo.operator
+                    + '", "difficulty": "' + jogo.difficulty
+                    + '", "num": "' + jogo.num
+                    + '"';
+            str += "}";
+            $.post(iLMparameters.iLM_PARAM_ServerToGetAnswerURL, {iLM_PARAM_ActivityEvaluation: 0, iLM_PARAM_ArchiveContent: str}, function (d) {});
+        }
+
+        function finish_redirect() {
+            var t = (parent.document.location + " ").split("?")[0];
+            t += "?id=" + getParameterFromParent("id") + "&userid_iassign=" + getParameterFromParent("userid_iassign");
+            t += "&action=view&iassign_current=" + getParameterFromParent("iassign_current");
+            if (parent.document.location == t) {
+                parent.document.location.reload();
+            } else {
+                window.parent.location = t + "#iLM";
+            }
+        }
+
+        function timeConverter(UNIX_timestamp) {
+            var a = new Date(UNIX_timestamp * 1000);
+            var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+            var year = a.getFullYear();
+            var month = months[a.getMonth()];
+            var date = a.getDate();
+            var hour = a.getHours();
+            var min = a.getMinutes();
+            var sec = a.getSeconds();
+            var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;
+            return time;
+        }
+
+        String.prototype.toHHMMSS = function () {
+            var sec_num = parseInt(this, 10); // don't forget the second param
+            var hours = Math.floor(sec_num / 3600);
+            var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
+            var seconds = sec_num - (hours * 3600) - (minutes * 60);
+
+            if (hours < 10) {
+                hours = "0" + hours;
+            }
+            if (minutes < 10) {
+                minutes = "0" + minutes;
+            }
+            if (seconds < 10) {
+                seconds = "0" + seconds;
+            }
+            return hours + ':' + minutes + ':' + seconds;
+        }
+        function getParameterFromParent(name) {
+            var match = RegExp('[?&]' + name + '=([^&]*)').exec(parent.document.location.search);
+            return match ? decodeURIComponent(match[1].replace(/\+/g, ' ')) : null;
+        }
+        function showInfo() {
+            var html = "<div class='modal-geral'> <div class='modal-title'>iFractions</div>"
+                    + "<div class='modal-coop'>Cooperation Team</div> <div class='modal-coop-content'> BRAZIL: Leônidas de Oliveira Brandão (IME-USP)<br>"
+                    + "PERU: Manuel Ibarra and Cristhian Serrano (EAPIIS-UNAMBA)<br> FRANCE: Jean-Marc (MOCAH-UPMC) </div>"
+                    + "<div class='modal-based'>Based on</div><div class='modal-based-content'> iLM (interactive Learning Modules)<br>"
+                    + "Six facets of Serious Game Design:<br>Pedagogical Objectives; Domain Simulation; Interactions with the Simulation; Problems and Progression; Decorum and Conditions of Use."
+                    + "</div> <div class='modal-tech'> Technology </div> <div class='modal-tech-content'> We used HTML5, CSS and the Javascript Library Phaser.io </div> </div>";
+            $(html).appendTo('body').modal();
+        }
+
+    </script>
+</html>

+ 277 - 0
js/boot.js

@@ -0,0 +1,277 @@
+var bootState = {
+    preload: function () {
+        //Progress bar image
+        game.load.image('progressBar', 'resource/img/global/pgbar.png');
+        //loading flags (manually)
+        game.load.image('flag_BR', 'resource/img/flag/BRAZ.jpg');
+        game.load.image('flag_PE', 'resource/img/flag/PERU.jpg');
+        game.load.image('flag_US', 'resource/img/flag/UNST.jpg');
+        game.load.image('flag_FR', 'resource/img/flag/FRAN.jpg');
+    },
+    create: function() {
+        //game settings
+        game.stage.backgroundColor = '#cce5ff';
+        
+        game.physics.startSystem(Phaser.Physics.ARCADE);
+        var style = { font: '28px Arial', fill: '#00804d', align: 'center' };
+        
+        /*
+        //generating language selection
+         //pt_BR
+        var title1 = game.add.text(this.game.world.centerX - 220, this.game.world.centerY - 100, 'FRACÇÕES', style);
+        title1.anchor.setTo(1, 0.5);
+        var flag1 = game.add.sprite(this.game.world.centerX - 220, this.game.world.centerY - 100, 'flag_BR');       
+        flag1.anchor.setTo(0, 0.5);
+        flag1.inputEnabled = true;
+        flag1.input.useHandCursor = true;
+        flag1.events.onInputDown.add(this.setLang,{lang:'pt_BR'});
+         //es_PE
+        var title2 = game.add.text(this.game.world.centerX + 200, this.game.world.centerY - 100, 'FRACCIONES', style);
+        title2.anchor.setTo(1, 0.5);
+        var flag2 = game.add.sprite(this.game.world.centerX + 200, this.game.world.centerY - 100, 'flag_PE');       
+        flag2.anchor.setTo(0, 0.5);
+        flag2.inputEnabled = true;
+        flag2.input.useHandCursor = true;
+        flag2.events.onInputDown.add(this.setLang,{lang:'es_PE'});
+         //en_US
+        var title3 = game.add.text(this.game.world.centerX - 220, this.game.world.centerY + 100, 'FRACTIONS', style);
+        title3.anchor.setTo(1, 0.5);
+        var flag3 = game.add.sprite(this.game.world.centerX - 220, this.game.world.centerY + 100, 'flag_US');       
+        flag3.anchor.setTo(0, 0.5);
+        flag3.inputEnabled = true;
+        flag3.input.useHandCursor = true;
+        flag3.events.onInputDown.add(this.setLang,{lang:'en_US'});
+         //fr_FR
+        var title4 = game.add.text(this.game.world.centerX + 200, this.game.world.centerY + 100, 'FRACTIONS', style);
+        title4.anchor.setTo(1, 0.5);
+        var flag4 = game.add.sprite(this.game.world.centerX + 200, this.game.world.centerY + 100, 'flag_FR');       
+        flag4.anchor.setTo(0, 0.5);
+        flag4.inputEnabled = true;
+        flag4.input.useHandCursor = true;
+        flag4.events.onInputDown.add(this.setLang,{lang:'fr_FR'});
+        */
+        
+        // Esquiva do menu de idioma ::Igor
+        game.state.start('load');
+    },
+    
+    setLang: function(){
+        //set language
+        lang = this.lang;
+        //start resource loading
+        game.state.start('load');
+    }
+};
+
+var loadState = {
+    
+    preload: function () {
+        //Progress bar image
+        game.load.image('progressBar', 'resource/img/global/pgbar.png');
+    },
+    
+    preload: function () {
+        
+        // Displaying the progress bar
+        var progressBar = game.add.sprite(game.world.centerX, game.world.centerY, 'progressBar');
+        progressBar.anchor.setTo(0.5, 0.5);
+        game.load.setPreloadSprite(progressBar);
+        
+        if(!oneMenu){
+            game.stage.backgroundColor = '#cce5ff';
+            game.physics.startSystem(Phaser.Physics.ARCADE);
+        }
+        
+        // Loading dictionary
+        game.load.json('dictionary', 'resource/lang/'+lang+'.json');
+                
+        // Loading global assets (sprites and images)
+        var baseimg = 'resource/img/global/';
+        
+        game.load.image('bgimage', baseimg+'bg.jpg');
+        game.load.image('bgmap', baseimg+'bg_map.png');
+        game.load.image('cloud', baseimg+'cloud.png');
+        game.load.image('floor', baseimg+'floor.png');
+        game.load.image('road', baseimg+'road.png');
+        
+         //games list buttons
+        game.load.image('game1c', baseimg+'game/one-c.png');
+		game.load.image('game2c', baseimg+'game/two-c.png');
+		game.load.image('game3c', baseimg+'game/three-c.png');
+		game.load.image('game4c', baseimg+'game/four-c.png');
+        game.load.image('game1s', baseimg+'game/one-s.png');
+		game.load.image('game2s', baseimg+'game/two-s.png');
+		game.load.image('game3s', baseimg+'game/three-s.png');
+		game.load.image('game4s', baseimg+'game/four-s.png');
+		game.load.image('game5s', baseimg+'game/five-s.png');
+         //header menu
+        game.load.image('back', baseimg+'menu/back.png');
+        game.load.image('home', baseimg+'menu/home.png');
+        game.load.image('info', baseimg+'menu/info.png');
+        game.load.image('about', baseimg+'menu/info.png');
+        game.load.image('list', baseimg+'menu/menu.png');
+        game.load.image('help', baseimg+'menu/help.png');
+        game.load.image('pgbar', baseimg+'menu/progressBar.png');
+        game.load.image('block', baseimg+'menu/block.png');
+        game.load.image('eraser', baseimg+'menu/eraser.png');
+         //operators
+		game.load.image('add', baseimg+'operator/add.png');
+		game.load.image('subtract', baseimg+'operator/subtract.png');
+		game.load.image('separator', baseimg+'operator/separator.png');
+		game.load.image('equal', baseimg+'operator/equal.png');
+         //helpers
+		game.load.image('h_arrow', baseimg+'help/arrow.png');
+		game.load.image('h_double', baseimg+'help/double.png');
+		game.load.image('h_error', baseimg+'help/error.png');
+		game.load.image('h_ok', baseimg+'help/ok.png');
+        game.load.image('down', baseimg+'help/down.png');        
+        game.load.image('pointer', baseimg+'help/pointer.png');
+        
+        // Loading assets based on lang
+        var basesrc = 'resource/img/'+lang+'/';
+        
+        game.load.spritesheet('kid_run', basesrc+'kid/run.png', 82, 178, 12);
+        game.load.spritesheet('kid_walk', basesrc+'kid/walk.png', 78, 175, 24);
+        game.load.spritesheet('kid_lost', basesrc+'kid/lost.png', 72, 170, 6);
+        game.load.spritesheet('tractor', basesrc+'tractor/frame.png', 201, 144, 10);
+        game.load.image('balloon', basesrc+'airballoon_upper.png');
+        game.load.image('balloon_basket', basesrc+'airballoon_base.png');
+        game.load.image('birch', basesrc+'birch.png');
+        game.load.image('flag', basesrc+'flag.png');
+        game.load.image('house', basesrc+'house.png');
+        game.load.image('place_a', basesrc+'place_a.png');
+        game.load.image('place_b', basesrc+'place_b.png');
+        game.load.image('garage', basesrc+'garage.png');
+        game.load.image('farm', basesrc+'farm.png');
+        game.load.image('rock', basesrc+'rock.png');
+        game.load.image('school', basesrc+'school.png');
+        game.load.image('sign', basesrc+'sign.png');
+        game.load.image('tree1', basesrc+'tree.png');
+        game.load.image('tree2', basesrc+'tree2.png');
+        game.load.image('tree3', basesrc+'tree3.png');
+        game.load.image('tree4', basesrc+'tree4.png');
+        
+                
+        // Loadind Sound Effects
+        game.load.audio('sound_ok', ['resource/fx/ok.ogg', 'resource/fx/ok.mp3']);
+        game.load.audio('sound_error', ['resource/fx/error.ogg', 'resource/fx/error.mp3']);
+        game.load.audio('sound_beep', ['resource/fx/beep.ogg', 'resource/fx/beep.mp3']);
+        
+    },
+    create: function() {  
+        game.state.start('name');
+    }
+};
+
+var nameLbl;
+var nameState = {
+    preload: function () {
+        //textbox
+    },
+    create: function() {
+        //game settings
+        game.stage.backgroundColor = '#cce5ff';
+        
+        var words =  game.cache.getJSON('dictionary');
+        
+        game.physics.startSystem(Phaser.Physics.ARCADE);
+        var style = { font: '30px Arial', fill: '#00804d', align: 'center' };
+        var styleName = { font: '44px Arial', fill: '#000000', align: 'center' };
+        
+        //generating language selection
+        var titulo = game.add.text(this.game.world.centerX, this.game.world.centerY - 100, words.insert_name, style);
+        titulo.anchor.setTo(0.5);
+        
+        var lineColor = 0x000000;
+        var fillColor = 0xfffff0;
+        
+        var nameBox = game.add.graphics(this.game.world.centerX - 200, this.game.world.centerY - 50);
+        nameBox.lineStyle(2, lineColor);
+        nameBox.beginFill(fillColor);
+        nameBox.drawRect(0, 0, 400, 100);
+        nameBox.alpha = 0.5;
+        nameBox.endFill();
+        
+        nameLbl = game.add.text(this.game.world.centerX, this.game.world.centerY, "", styleName);
+        nameLbl.anchor.setTo(0.5);
+        
+        var clear = game.add.sprite(game.world.centerX + 250, game.world.centerY, 'eraser');
+        clear.scale.setTo(0.8);
+        clear.anchor.setTo(0.5);
+        
+        clear.inputEnabled = true;
+        clear.input.useHandCursor = true;
+        clear.events.onInputDown.add(this.clearName, null);
+        
+        var btn = game.add.graphics(this.game.world.centerX - 84, this.game.world.centerY +70);
+        btn.lineStyle(1, 0x293d3d);
+        btn.beginFill(0x3d5c5c);
+        btn.drawRect(0, 0, 168, 60);
+        btn.alpha = 0.5;
+        btn.endFill();
+        
+        btn.inputEnabled = true;
+        btn.input.useHandCursor = true;
+        btn.events.onInputDown.add(this.ready, null);
+        
+        var listo = game.add.text(this.game.world.centerX+1, this.game.world.centerY + 102, words.ready, { font: '34px Arial', fill: '#f0f5f5', align: 'center' });
+        listo.anchor.setTo(0.5);
+        
+        game.input.keyboard.addCallbacks(this, null, null, this.keyPress);
+        
+        // Chama direto o menu ::Igor
+        name = "Maria";
+        console.log("name is " + name);
+        game.state.start('menu');
+    },
+    
+    clearName: function(){
+        nameLbl.text  = "";
+    },
+    
+    keyPress: function(char) {
+        var RegExpression = /^[a-zA-Z\s]*$/; 
+
+        if (RegExpression.test(char)) {
+            nameLbl.text += char;
+        }        
+    },
+    ready: function(){
+        //var txt = nameLbl.text.trim;
+        console.log(nameLbl.text.length);
+        if(nameLbl.text.trim().length==0){
+            nameLbl.text  = "";
+            return;
+        }
+        
+        name = nameLbl.text.trim();
+        console.log("name is " + name);
+        
+        
+        if(oneMenu){ //If menu, normal game
+            // Go to the menu state
+            game.state.start('menu');
+        }else{ //parameters game
+            if(oneShape=="Circle"){
+                game.state.start("mapCOne");
+            }else if(oneShape=="Square"){
+                if(oneOperator=='Mixed'){
+                    twoPosition = 0;
+                    twoMove = true;
+                    twoDifficulty = oneDifficulty; 
+                    twoOperator= "";
+                    twoLabel= false;
+                    twoShape = oneShape;
+                    twoType = oneType;
+                    twoMenu = false;
+                    
+                    game.state.start("mapSTwo");
+                }else{
+                    game.state.start("mapSOne");
+                }
+            }
+            
+        }
+        
+    }
+};

File diff suppressed because it is too large
+ 1100 - 0
js/circleOne.js


File diff suppressed because it is too large
+ 18706 - 0
js/jquery-ui.js


File diff suppressed because it is too large
+ 5 - 0
js/jquery.js


File diff suppressed because it is too large
+ 4 - 0
js/jquery.min.js


File diff suppressed because it is too large
+ 5 - 0
js/jquery.modal.min.js


+ 229 - 0
js/menu.js

@@ -0,0 +1,229 @@
+var menu1, menu2, menu3, menu4;
+var m_info, m_world, m_menu, m_back, m_help;
+var beepSound;
+
+var words;
+var lbl_game;
+var menuState={
+    create: function() {
+        
+        // Creating sound variable
+        beepSound = game.add.audio('sound_beep');
+        
+        // Reading dictionary
+        words = game.cache.getJSON('dictionary');
+        
+        // Setting title
+        var style = { font: "32px Arial", fill: "#00804d", align: "center" };
+        var title = game.add.text(this.game.world.centerX, 80, words.menu_title, style);
+        title.anchor.setTo(0.5,0.5);
+        
+        // game selection text
+        var style_game = { font: "27px Arial", fill: "#003cb3", align: "center" };
+        lbl_game = game.add.text(this.game.world.centerX, 110, "", style_game);
+        lbl_game.anchor.setTo(0.5,0.5);
+        
+        // Menu options
+         //information label
+        m_info = game.add.text(14, 53, "", { font: "20px Arial", fill: "#330000", align: "center" });
+          // Return to language button
+        
+        // Remove language icon ::Igor
+        m_world = game.add.sprite(10, 10, 'about'); 
+        m_world.inputEnabled = true;
+        m_world.input.useHandCursor = true;
+        m_world.events.onInputDown.add(this.loadState, {state: "boot", beep: beepSound});
+        m_world.events.onInputOver.add(this.showOption, {message: words.menu_world});
+        m_world.events.onInputOut.add(this.showOption, {message: ""});
+                
+        // List buttons
+        menu1 = game.add.sprite(this.game.world.centerX + 10, this.game.world.centerY - 70, 'game1c');
+        menu2 = game.add.sprite(this.game.world.centerX + 160, this.game.world.centerY - 70, 'game2c');
+        menu3 = game.add.sprite(this.game.world.centerX + 10, this.game.world.centerY + 90, 'game3c');
+        menu4 = game.add.sprite(this.game.world.centerX + 160, this.game.world.centerY + 90, 'game4c');
+        
+        menu5 = game.add.sprite(this.game.world.centerX - 350, this.game.world.centerY - 70, 'game1s');
+        menu6 = game.add.sprite(this.game.world.centerX - 200, this.game.world.centerY - 70, 'game2s');
+        menu7 = game.add.sprite(this.game.world.centerX - 350, this.game.world.centerY + 90, 'game3s');
+        menu8 = game.add.sprite(this.game.world.centerX - 200, this.game.world.centerY + 90, 'game4s');
+        
+        menu9 = game.add.sprite(this.game.world.centerX + 350, this.game.world.centerY -70, 'game5s');
+        
+        // Buttons actions
+        menu1.anchor.setTo(0.5, 0.5);
+        menu1.inputEnabled = true;
+        menu1.input.useHandCursor = true;
+        menu1.events.onInputDown.add(this.loadGame,{num:1, beep: beepSound, shape : "Circle", label : true});
+        menu1.events.onInputOver.add(this.showTitle,{num:1, beep: beepSound, shape : "Circle", label : true});
+        menu1.events.onInputOut.add(this.clearTitle);
+        
+        menu2.anchor.setTo(0.5, 0.5);
+        menu2.inputEnabled = true;
+        menu2.input.useHandCursor = true;
+        menu2.events.onInputDown.add(this.loadGame,{num:2, beep: beepSound, shape : "Circle", label : false});
+        menu2.events.onInputOver.add(this.showTitle,{num:2, beep: beepSound, shape : "Circle", label : false});
+        menu2.events.onInputOut.add(this.clearTitle);
+        
+        menu3.anchor.setTo(0.5, 0.5);
+        menu3.inputEnabled = true;
+        menu3.input.useHandCursor = true;
+        menu3.events.onInputDown.add(this.loadGame,{num:3, beep: beepSound, shape : "Circle", label : true});
+        menu3.events.onInputOver.add(this.showTitle,{num:3, beep: beepSound, shape : "Circle", label : true});
+        menu3.events.onInputOut.add(this.clearTitle);
+        
+        menu4.anchor.setTo(0.5, 0.5);
+        menu4.inputEnabled = true;
+        menu4.input.useHandCursor = true;
+        menu4.events.onInputDown.add(this.loadGame,{num:4, beep: beepSound, shape : "Circle", label : false});
+        menu4.events.onInputOver.add(this.showTitle,{num:4, beep: beepSound, shape : "Circle", label : false});
+        menu4.events.onInputOut.add(this.clearTitle);
+        
+        menu5.anchor.setTo(0.5, 0.5);
+        menu5.inputEnabled = true;
+        menu5.input.useHandCursor = true;
+        menu5.events.onInputDown.add(this.loadGame,{num:1, beep: beepSound, shape : "Square", label : true});
+        menu5.events.onInputOver.add(this.showTitle,{num:1, beep: beepSound, shape : "Square", label : true});
+        menu5.events.onInputOut.add(this.clearTitle);
+        
+        menu6.anchor.setTo(0.5, 0.5);
+        menu6.inputEnabled = true;
+        menu6.input.useHandCursor = true;
+        menu6.events.onInputDown.add(this.loadGame,{num:2, beep: beepSound, shape : "Square", label : false});
+        menu6.events.onInputOver.add(this.showTitle,{num:2, beep: beepSound, shape : "Square", label : false});
+        menu6.events.onInputOut.add(this.clearTitle);
+        
+        menu7.anchor.setTo(0.5, 0.5);
+        menu7.inputEnabled = true;
+        menu7.input.useHandCursor = true;
+        menu7.events.onInputDown.add(this.loadGame,{num:3, beep: beepSound, shape : "Square", label : true});
+        menu7.events.onInputOver.add(this.showTitle,{num:3, beep: beepSound, shape : "Square", label : true});
+        menu7.events.onInputOut.add(this.clearTitle);
+        
+        menu8.anchor.setTo(0.5, 0.5);
+        menu8.inputEnabled = true;
+        menu8.input.useHandCursor = true;
+        menu8.events.onInputDown.add(this.loadGame,{num:4, beep: beepSound, shape : "Square", label : false});
+        menu8.events.onInputOver.add(this.showTitle,{num:4, beep: beepSound, shape : "Square", label : false});
+        menu8.events.onInputOut.add(this.clearTitle);
+        
+        menu9.anchor.setTo(0.5, 0.5);
+        menu9.inputEnabled = true;
+        menu9.input.useHandCursor = true;
+        menu9.events.onInputDown.add(this.loadGame,{num:5, beep: beepSound, shape : "Square", label : false});
+        menu9.events.onInputOver.add(this.showTitle,{num:5, beep: beepSound, shape : "Square", label : false});
+        menu9.events.onInputOut.add(this.clearTitle);
+
+        // Floor
+        for(var i=0;i<9;i++){
+            game.add.image(i*100, 501, 'floor');
+        }
+        
+        // ::Igor
+        this.num = parseInt(jogo.num);
+        oneShape = jogo.shape;
+        this.shape= jogo.shape;
+        oneLabel = jogo.label;
+        oneType = jogo.modo;
+        twoType = jogo.modo;
+        
+        if( (this.num==1 || this.num==2) && this.shape=="Circle"){
+            game.state.start('menuCOne');
+        }
+        if( (this.num==3 || this.num==4) && this.shape=="Circle"){
+            game.state.start('menuCOne');
+        }
+        if( (this.num==1 || this.num==2) && this.shape=="Square"){
+            game.state.start('menuSOne');
+        }
+        if( (this.num==3 || this.num==4) && this.shape=="Square"){
+            game.state.start('menuSOne');
+        }
+        if( this.num==5 && this.shape=="Square"){
+            game.state.start('menuSTwo');
+        }
+        // ::Igor
+
+        
+    },
+    
+    loadGame: function(){
+        this.beep.play();
+        if( (this.num==1 || this.num==2) && this.shape=="Circle"){
+            oneShape = this.shape;
+            oneLabel = this.label;
+            oneType = "A";
+            game.state.start('menuCOne');
+        }
+        if( (this.num==3 || this.num==4) && this.shape=="Circle"){
+            oneShape = this.shape;
+            oneLabel = this.label;
+            oneType = "B";
+            game.state.start('menuCOne');
+        }
+        if( (this.num==1 || this.num==2) && this.shape=="Square"){
+            oneShape = this.shape;
+            oneLabel = this.label;
+            oneType = "A";
+            game.state.start('menuSOne');
+        }
+        if( (this.num==3 || this.num==4) && this.shape=="Square"){
+            oneShape = this.shape;
+            oneLabel = this.label;
+            oneType = "B";
+            game.state.start('menuSOne');
+        }
+        if( this.num==5 && this.shape=="Square"){
+            twoShape = this.shape;
+            twoLabel = this.label;
+            twoType = "";
+            game.state.start('menuSTwo');
+        }
+    },
+    showTitle: function(){
+        
+        var title = "";
+        var type = "";
+        
+        if( (this.num==1 || this.num==2) ){
+            type = "A";
+        }
+        if( (this.num==3 || this.num==4) ){
+            type = "B";
+        }
+        if( this.num==5 && this.shape=="Square"){
+            type = "C";
+        }
+        
+        if(this.shape=="Circle"){
+            title += words.circle_name;
+        }else if(this.shape=="Square"){
+            title += words.square_name;
+        }
+        
+        if(type!=""){
+            title  += ", "+words.mode_name+ " "+type;
+        }
+        
+        if(this.label){
+            title += ", " + words.with_name + " " + words.label_name;
+        }else{
+            title += ", " + words.without_name + " " + words.label_name;
+        }
+        
+        lbl_game.text = title;
+    },
+    clearTitle: function(){
+        lbl_game.text = "";
+    },
+    
+    showOption: function(){
+        m_info.text = this.message;
+    },    
+    
+    loadState: function(){
+        this.beep.play();
+        game.state.start(this.state);
+    }
+    
+};
+

File diff suppressed because it is too large
+ 103065 - 0
js/phaser.js


File diff suppressed because it is too large
+ 28 - 0
js/phaser.min.js


File diff suppressed because it is too large
+ 1072 - 0
js/squareOne.js


+ 943 - 0
js/squareTwo.js

@@ -0,0 +1,943 @@
+// Fractions Comparison Square states
+/****************************** MENU ****************************/
+var menuSquareTwo={
+    create: function() {
+        
+        // Creating sound variable
+        var beepSound = game.add.audio('sound_beep');
+        
+        // Reading dictionary
+        var words = game.cache.getJSON('dictionary');
+          
+        // Menu options
+          //information label
+        m_info = game.add.text(14, 53, "", { font: "20px Arial", fill: "#330000", align: "center" });
+          // Return to language button
+        // Remove language icon ::Igor
+        m_world = game.add.sprite(10, 10, 'about'); 
+        m_world.inputEnabled = true;
+        m_world.input.useHandCursor = true;
+        m_world.events.onInputDown.add(showInfo);
+        m_world.events.onInputOver.add(this.showOption, {message: words.menu_world});
+        m_world.events.onInputOut.add(this.showOption, {message: ""});
+        
+          // Return to menu button
+        m_list = game.add.sprite(60, 10, 'list'); 
+        m_list.inputEnabled = true;
+        m_list.input.useHandCursor = true;
+        m_list.events.onInputDown.add(this.loadState, {state: "menu", beep: beepSound});
+        m_list.events.onInputOver.add(this.showOption, {message: words.menu_list});
+        m_list.events.onInputOut.add(this.showOption, {message: ""});
+        
+        // Setting title
+        var style = { font: '28px Arial', fill: '#00804d'};
+        var title = game.add.text(860, 40, words.game_menu_title, style);
+        title.anchor.setTo(1, 0.5);
+        
+        //Showing Games and Levels
+        var maxHeight = 120; //Max height of a stair
+        var stairHeight = 29; //height growth of a stair
+        var stairWidth = 80; //Width of a stair
+        var startStair = 240;
+        var startSymbol = 150;
+        var startSquare = (startSymbol/2)+startStair+stairWidth*5;
+        
+        var bplus = game.add.sprite(startSymbol, 300, 'equal');
+            bplus.frame = 0;
+            bplus.scale.setTo(0.7);
+            bplus.anchor.setTo(0.5,0.5);
+            
+         //First stairs, 6 levels
+
+        var stairsA = [];
+        for(var i=1;i<=5;i++){
+            //stair
+            var x1 = startStair+(stairWidth*(i-1));
+            var y1 = 100+maxHeight-i*stairHeight;
+            var x2 = stairWidth;//x1 + 40;
+            var y2 = stairHeight*i;//y1 + 24;
+            
+            stairsA[i] = game.add.graphics(0, 0);
+            stairsA[i].lineStyle(1, 0xFFFFFF, 1);
+            stairsA[i].beginFill(0x99b3ff);
+            stairsA[i].drawRect(x1, y1, x2, y2);
+            stairsA[i].endFill();
+            
+            //event
+            stairsA[i].inputEnabled = true;
+            stairsA[i].input.useHandCursor = true;
+            stairsA[i].events.onInputDown.add(this.loadMap, {beep: beepSound, difficulty: i, type: 'A' });
+            stairsA[i].events.onInputOver.add(function (item) { item.alpha=0.5; }, this);
+            stairsA[i].events.onInputOut.add(function (item) { item.alpha=1; }, this);
+            //label
+            var xl = x1+stairWidth/2; //x label
+            var yl = y1+(stairHeight*i)/2; //y label
+            var label = game.add.text(xl, yl, i, { font: '25px Arial', fill: '#ffffff', align: 'center' });
+                label.anchor.setTo(0.5, 0.4);
+        }
+                
+        var stairsB = [];
+        for(var i=1;i<=5;i++){
+            //stair
+            var x1 = startStair+(stairWidth*(i-1));
+            var y1 = 270+maxHeight-i*stairHeight;
+            var x2 = stairWidth;//x1 + 40;
+            var y2 = stairHeight*i;//y1 + 24;
+            
+            stairsB[i] = game.add.graphics(0, 0);
+            stairsB[i].lineStyle(1, 0xFFFFFF, 1);
+            stairsB[i].beginFill(0xff6666);
+            stairsB[i].drawRect(x1, y1, x2, y2);
+            stairsB[i].endFill();
+            
+            //event
+            stairsB[i].inputEnabled = true;
+            stairsB[i].input.useHandCursor = true;
+            stairsB[i].events.onInputDown.add(this.loadMap, {beep: beepSound, difficulty: i, type: 'B' });
+            stairsB[i].events.onInputOver.add(function (item) { item.alpha=0.5; }, this);
+            stairsB[i].events.onInputOut.add(function (item) { item.alpha=1; }, this);
+            //label
+            var xl = x1+stairWidth/2; //x label
+            var yl = y1+(stairHeight*i)/2; //y label
+            var label = game.add.text(xl, yl, i, { font: '25px Arial', fill: '#ffffff', align: 'center' });
+                label.anchor.setTo(0.5, 0.4);
+        } 
+        
+                
+        var stairsC = [];
+        for(var i=1;i<=5;i++){
+            //stair
+            var x1 = startStair+(stairWidth*(i-1));
+            var y1 = 440+maxHeight-i*stairHeight;
+            var x2 = stairWidth;//x1 + 40;
+            var y2 = stairHeight*i;//y1 + 24;
+            
+            stairsC[i] = game.add.graphics(0, 0);
+            stairsC[i].lineStyle(1, 0xFFFFFF, 1);
+            stairsC[i].beginFill(0xb366ff);
+            stairsC[i].drawRect(x1, y1, x2, y2);
+            stairsC[i].endFill();
+            
+            //event
+            stairsC[i].inputEnabled = true;
+            stairsC[i].input.useHandCursor = true;
+            stairsC[i].events.onInputDown.add(this.loadMap, {beep: beepSound, difficulty: i, type: 'C' });
+            stairsC[i].events.onInputOver.add(function (item) { item.alpha=0.5; }, this);
+            stairsC[i].events.onInputOut.add(function (item) { item.alpha=1; }, this);
+            //label
+            var xl = x1+stairWidth/2; //x label
+            var yl = y1+(stairHeight*i)/2; //y label
+            var label = game.add.text(xl, yl, i, { font: '25px Arial', fill: '#ffffff', align: 'center' });
+                label.anchor.setTo(0.5, 0.4);
+        } 
+
+        // ::Igor
+        //this.beep.play();
+        twoPosition = 0; //Map position
+        twoMove = true; //Move no next point
+        twoDifficulty  = jogo.difficulty; //Number of difficulty (1 to 5)
+        twoType = jogo.modo;
+        game.state.start('mapSTwo');
+        /// ::Igor
+
+    },
+    
+    //Navigation functions,
+    
+    showOption: function(){
+        m_info.text = this.message;
+    },    
+    
+    loadState: function(){
+        this.beep.play();
+        game.state.start(this.state);
+    },
+        
+        
+    //MapLoading function
+    loadMap: function(){
+        this.beep.play();
+        twoPosition = 0; //Map position
+        twoMove = true; //Move no next point
+        twoDifficulty  = this.difficulty; //Number of difficulty (1 to 5)
+        twoType = this.type; //Operator of game
+        if(twoPosition<5){
+            game.state.start('mapSTwo');
+        }else{
+            game.state.start('unofinal');
+        }
+    }
+    
+};
+
+/****************************** MAP ****************************/
+var mapSquareTwo={
+    create: function() {
+                
+        // Creating sound variable
+        beepSound = game.add.audio('sound_beep');
+        
+        // Reading dictionary
+        var words = game.cache.getJSON('dictionary');
+
+        // Background
+        game.add.image(0, 40, 'bgmap');
+        
+        if(oneMenu){
+            // Menu options
+              //information label
+            m_info = game.add.text(14, 53, "", { font: "20px Arial", fill: "#330000", align: "center" });
+              // Return to language button
+            // Remove language icon ::Igor
+            m_world = game.add.sprite(10, 10, 'about'); 
+            m_world.inputEnabled = true;
+            m_world.input.useHandCursor = true;
+            m_world.events.onInputDown.add(showInfo);
+            m_world.events.onInputOver.add(this.showOption, {message: words.menu_world});
+            m_world.events.onInputOut.add(this.showOption, {message: ""});
+              // Return to menu button
+            m_list = game.add.sprite(60, 10, 'list'); 
+            m_list.inputEnabled = true;
+            m_list.input.useHandCursor = true;
+            m_list.events.onInputDown.add(this.loadState, {state: "menu", beep: beepSound});
+            m_list.events.onInputOver.add(this.showOption, {message: words.menu_list});
+            m_list.events.onInputOut.add(this.showOption, {message: ""});
+              // Return to diffculty
+            m_back = game.add.sprite(110, 10, 'back'); 
+            m_back.inputEnabled = true;
+            m_back.input.useHandCursor = true;
+            m_back.events.onInputDown.add(this.loadState, {state: "menuSTwo", beep: beepSound});
+            m_back.events.onInputOver.add(this.showOption, {message: words.menu_back});
+            m_back.events.onInputOut.add(this.showOption, {message: ""});
+        }
+        
+        // Styles for labels
+        var stylePlace = { font: '26px Arial', fill: '#ffffff', align: 'center'};
+        var styleMenu = { font: '30px Arial', fill: '#000000', align: 'center'};
+        
+        // Progress bar
+        var percentText = onePosition*20;
+        var percentBlocks = onePosition;
+        for(var p=1;p<=percentBlocks;p++){
+            var block = game.add.image(680+(p-1)*30, 10, 'block');
+            block.scale.setTo(2, 1); //Scaling to double width
+        }
+        game.add.text(840, 10, percentText+'%', styleMenu);
+        game.add.text(670, 10, words.difficulty + ' ' + oneDifficulty, styleMenu).anchor.setTo(1,0);
+        game.add.image(680, 10, 'pgbar');
+        
+         //Road
+        this.points = {
+        'x': [ 90, 204, 318, 432, 546, 660 ],
+        'y': [ 486, 422, 358, 294, 230, 166 ]
+        };
+
+        
+         //Road
+        this.points = {
+        'x': [ 90, 204, 318, 432, 546, 660 ],
+        'y': [ 486, 422, 358, 294, 230, 166 ]
+        };
+        
+          //House
+        var house = game.add.image(this.points.x[0], this.points.y[0], 'house');
+        house.scale.setTo(0.7);
+        house.anchor.setTo(0.7, 0.8);
+         //School
+        var school = game.add.image(this.points.x[5], this.points.y[5], 'school');
+        school.scale.setTo(0.35);
+        school.anchor.setTo(0.2, 0.7);
+        
+         //Trees and Rocks
+        
+        this.rocks = {
+             'x': [156, 275, 276, 441, 452, 590, 712],
+             'y': [309, 543, 259, 156, 419, 136, 316]
+        }
+        this.r_types = [1, 1, 2, 1, 2, 2, 2];
+        
+        for(var i=0; i<this.r_types.length; i++){
+            if(this.r_types[i]==1){
+                var sprite = game.add.image(this.rocks.x[i], this.rocks.y[i], 'rock');
+                sprite.scale.setTo(0.32);
+                sprite.anchor.setTo(0.5, 0.95);
+            }else if(this.r_types[i]==2){
+                var sprite = game.add.image(this.rocks.x[i], this.rocks.y[i], 'birch');
+                sprite.scale.setTo(0.4);
+                sprite.anchor.setTo(0.5, 0.95);
+            }
+        }
+        this.trees = {
+             'x': [105, 214, 354, 364, 570, 600, 740, 779],
+             'y': [341, 219, 180, 520, 550, 392, 488, 286]
+        }
+        this.t_types = [2, 4, 3, 4, 1, 2, 4, 4];
+        
+        for(var i=0; i<this.t_types.length; i++){
+            var sprite = game.add.image(this.trees.x[i], this.trees.y[i], 'tree'+this.t_types[i]);
+            sprite.scale.setTo(0.6);
+            sprite.anchor.setTo(0.5, 0.95);
+        }
+
+        
+        // places
+        for (var p = 1; p < this.points.x.length -1; p++){
+            var place;
+            if(p<twoPosition)
+                place = game.add.image(this.points.x[p], this.points.y[p], 'place_b');
+            else if (twoMove && p==twoPosition)
+                place = game.add.image(this.points.x[p], this.points.y[p], 'place_b');
+            else
+                place = game.add.image(this.points.x[p], this.points.y[p], 'place_a');
+            place.anchor.setTo(0.5, 0.5);
+            place.scale.setTo(0.3);
+            var sign = game.add.image(this.points.x[p]-20, this.points.y[p]-60, 'sign');
+            sign.anchor.setTo(0.5, 1);
+            sign.scale.setTo(0.4);
+            if(p>0 && p<this.points.x.length-1){
+                var text = game.add.text(this.points.x[p]-23, this.points.y[p]-84, p, stylePlace);
+                text.anchor.setTo(0.35, 0.5);
+            }
+        }
+
+        // Kid start position
+        this.kid = game.add.sprite(this.points.x[twoPosition], this.points.y[twoPosition], 'kid_run');
+        this.kid.anchor.setTo(0.5,1);
+        this.kid.scale.setTo(0.5);
+        game.physics.arcade.enable(this.kid);
+        this.kid.animations.add('run');
+        this.kid.animations.play('run', 6, true);
+        
+        // Delay to next level
+        this.count = 0;
+        this.wait = 60;
+    },
+
+    update: function() {
+        
+        // Wait before moving or staring a game
+        this.count ++;
+        if(this.count<=this.wait) return;
+        
+        // If movement is stopped or position is 5 (final), load game
+        if(twoPosition==5){
+            twoMove = false;
+        }
+        
+        if(!twoMove){
+            this.loadGame();
+        }
+        
+        // If momevent is enabled, move to next point from actual
+        if(twoMove){
+            game.physics.arcade.moveToXY(
+                this.kid, 
+                this.points.x[twoPosition+1],
+                this.points.y[twoPosition+1],
+                100
+            );
+            
+            // I tractor reached the end, stop movement
+            if(Math.ceil(this.kid.x)==this.points.x[twoPosition+1] || Math.ceil(this.kid.y)==this.points.y[twoPosition+1]){
+                twoMove=false;
+                twoPosition += 1; //Update position
+            }
+        }
+    },
+    //Navigation functions
+    
+    showOption: function(){
+        m_info.text = this.message;
+    },    
+    
+    loadState: function(){
+        this.beep.play();
+        game.state.start(this.state);
+    },
+        
+    //MapLoading function
+    loadGame: function(){
+        beepSound.play();
+        if(twoPosition<5){
+            game.state.start('gameSTwo');
+        }else{
+            game.state.start('endSTwo');
+        }
+    }
+};
+
+/****************************** GAME ****************************/
+var sizeA, sizeB, valueA, valueB;
+var clickA, clickB, animateA, animateB, result, animate, cDelay, eDelay;
+var blocksA, blocksB, auxblqA, auxblqB;
+var labelA, fractionA, separatorA, labelB, fractionB, separatorB;
+var kid, kidDirection, equals, counter, endCounter;
+var xA, yA, xB, yB, blockW, blockH;
+var okImg, errorImg;
+
+var gameSquareTwo={
+    create: function() {  
+        
+        // ::Igor
+        if (conta == true) {
+            start[iterator] = Math.floor(Date.now()/1000);
+            conta = false;
+        }
+        
+        //timer
+        totalTime = 0;
+        timer = game.time.create(false);
+        timer.loop(1000, this.updateCounter, this);
+        timer.start();        
+        
+        points = [2,4,6,8,9,10,12,14,15,16,18,20];
+        
+        // Creating sound variable
+        beepSound = game.add.audio('sound_beep');
+        okSound = game.add.audio('sound_ok');
+        errorSound = game.add.audio('sound_error');
+        
+        // Reading dictionary
+        var words = game.cache.getJSON('dictionary');
+
+        // Background
+        game.add.image(0, 0, 'bgimage');
+        
+        //Clouds
+        game.add.image(300, 100, 'cloud');
+        game.add.image(660, 80, 'cloud');
+        game.add.image(110, 85, 'cloud').scale.setTo(0.8);
+        
+        // Styles for labels
+        var stylePlace = { font: '26px Arial', fill: '#400080', align: 'center'};
+        var styleLabel = { font: '26px Arial', fill: '#000080', align: 'center'};
+        var styleFraction = { font: '20px Arial', fill: '#000080', align: 'center'};
+        var styleMenu = { font: '30px Arial', fill: '#000000', align: 'center'};
+        
+        //Floor
+        for(var i=0;i<9;i++){
+            game.add.image(i*100, 501, 'floor');
+        }
+             
+        //kid
+        kid = game.add.sprite(100, 470, 'kid_walk');
+        kid.anchor.setTo(0.5, 0.7);
+        kid.scale.setTo(0.8);
+        kid.animations.add('right',[0,1,2,3,4,5,6,7,8,9,10,11]);
+        kid.animations.add('left',[23,22,21,20,19,18,17,16,15,14,13,12]);
+        kidDirection = 'right';
+        kid.animations.play('right', 6, true);
+                
+        //Control variables
+        sizeA = 0; //Size of first block
+        sizeB = 0; //Size of second block
+        valueA = 0; //Number of clicked blocks for a
+        valueB = 0; //Number of clicked blocks for b
+                
+        clickA = false; //If block A is clicked
+        clickB = false; //If block B is clicked
+        animateA = false; //Animate A selected blocks to position
+        animateB = false; //Animate B selected blocks to position
+        result = false; //Game is correct
+        animate = null; //Final animation sequence
+        
+         //generator
+        console.log("Diff " + twoDifficulty + ", ini " + ((twoDifficulty-1)*2+1) + ", end " + ((twoDifficulty-1)*2+3));
+        var rPoint = game.rnd.integerInRange((twoDifficulty-1)*2+1,(twoDifficulty-1)*2+3);
+        sizeA = points[rPoint];
+        console.log("Rpoint " + rPoint + ", val " + sizeA);
+        sizeB =  this.getRndDivisor(sizeA);
+        blockB = game.rnd.integerInRange(1, sizeB);
+        blockA = (sizeA/sizeB) * blockB;
+        
+        console.log("SA " + sizeA + ", SB " + sizeB + ", BA " + blockA + ", BB " + blockB );
+        
+        //Blocks and fractions group
+        blocksA = game.add.group(); //Main blocks A
+        blocksB = game.add.group(); //Main blocks B
+        auxblqA = game.add.group(); //Auxiliar blocks A
+        auxblqB = game.add.group(); //Auxiliar blocks B
+        
+         //Creating blocks
+        blockW = 400;
+        blockH = 50;
+        if(twoType!="C"){
+            xA=230, yA=90;
+            xB=xA, yB=yA+3*blockH+30;
+        }else{
+            xB=230, yB=90;
+            xA=xB, yA=yB+3*blockH+30;
+        }
+             
+        //Blocks A
+        var widthA = blockW/sizeA;
+        var lineColor = 0x1e2f2f;
+        var fillColor = 0x83afaf;
+        var fillColorS = 0xe0ebeb;
+        
+        for(var i=0; i<sizeA; i++){
+            //console.log("Block A"+i+": x:"+(xA+i*widthA)+", y:"+yA);
+                        
+            var block = game.add.graphics(xA+i*widthA, yA);
+                block.anchor.setTo(0.5, 0.5);
+                block.lineStyle(2, lineColor);
+                block.beginFill(fillColor);
+                block.drawRect(0, 0, widthA, blockH);
+                block.alpha = 0.5;
+                block.endFill();
+
+                block.inputEnabled = true;
+                block.input.useHandCursor = true;
+                block.events.onInputDown.add(this.clickSquare, {who: 'A',indice: i});
+                block.events.onInputOver.add(this.overSquare, {who: 'A',indice: i});
+                block.events.onInputOut.add(this.outSquare, {who: 'A',indice: i});
+            
+            blocksA.add(block);
+            
+            //aux blocks
+            var xAux = xA+i*widthA, yAux = yA+blockH+10;
+            if(twoType == 'C') yAux = yA;
+            var block = game.add.graphics(xAux, yAux );
+                block.anchor.setTo(0.5, 0.5);
+                block.lineStyle(1, lineColor);
+                block.beginFill(fillColorS);
+                block.drawRect(0, 0, widthA, blockH);
+                
+                if(twoType!='A') block.alpha = 0;
+                else block.alpha = 0.2;
+                    
+            auxblqA.add(block);
+            
+        }
+        
+        //label block A
+        var labelX = xA+blockW+30;
+        var labelY = yA+blockH/2;
+        labelA = game.add.text(labelX, labelY, sizeA , styleFraction);
+        labelA.anchor.setTo(0.5, 0.41);
+        
+        //label fraction
+        labelX = xA+(blockA*widthA)+40;
+        labelY = yA+blockH+34;
+        fractionA = game.add.text(labelX, labelY, "0\n"+sizeA , styleFraction);
+        fractionA.anchor.setTo(0.5, 0.41);
+        separatorA = game.add.sprite(labelX, labelY, 'separator');
+        separatorA.anchor.setTo(0.5, 0.5);
+        
+        fractionA.alpha = 0;
+        separatorA.alpha = 0;
+        
+        //Blocks B
+        var widthB = blockW/sizeB;
+        lineColor = 0x260d0d;
+        fillColor = 0xd27979;
+        fillColorS = 0xf2d9d9;
+               
+        for(var i=0; i<sizeB; i++){
+                        
+            var block = game.add.graphics(xB+i*widthB, yB);
+                block.anchor.setTo(0.5, 0.5);
+                block.lineStyle(2, lineColor);
+                block.beginFill(fillColor);
+                block.drawRect(0, 0, widthB, blockH);
+                block.endFill();
+            
+                block.inputEnabled = true;
+                block.input.useHandCursor = true;
+                block.events.onInputDown.add(this.clickSquare, {who: 'B',indice: i});
+                block.events.onInputOver.add(this.overSquare, {who: 'B',indice: i});
+                block.events.onInputOut.add(this.outSquare, {who: 'B',indice: i});
+
+            blocksB.add(block);
+            //aux blocks
+            var xAux = xB+i*widthB, yAux = yB+blockH+10;
+            if(twoType == 'C') yAux = yB;
+            var block = game.add.graphics(xAux, yAux);
+                block.anchor.setTo(0.5, 0.5);
+                block.lineStyle(1, lineColor);
+                block.beginFill(fillColorS);
+                block.drawRect(0, 0, widthB, blockH);
+                
+                if(twoType!='A') block.alpha = 0;
+                else block.alpha = 0.2;
+            auxblqB.add(block);
+            
+        }
+        
+        //label block B
+        labelX = xA+blockW+30;
+        labelY = yB+blockH/2;
+        labelB = game.add.text(labelX, labelY, sizeB , styleFraction);
+        labelB.anchor.setTo(0.5, 0.41);    
+                
+        //label fraction
+        labelX = xA+(blockB*widthB)+40;
+        labelY = yB+blockH+34;
+        fractionB = game.add.text(labelX, labelY, "0\n"+sizeB , styleFraction);
+        fractionB.anchor.setTo(0.5, 0.41);
+        separatorB = game.add.sprite(labelX, labelY, 'separator');
+        separatorB.anchor.setTo(0.5, 0.5);
+        
+        fractionB.alpha = 0;
+        separatorB.alpha = 0;
+        
+        
+          //information label
+        m_info = game.add.text(14, 53, "", { font: "20px Arial", fill: "#330000", align: "center" });
+        
+        if(twoMenu){
+              // Return to language button
+            // Remove language icon ::Igor
+            m_world = game.add.sprite(10, 10, 'about'); 
+            m_world.inputEnabled = true;
+            m_world.input.useHandCursor = true;
+            m_world.events.onInputDown.add(showInfo);
+            m_world.events.onInputOver.add(this.showOption, {message: words.menu_world});
+            m_world.events.onInputOut.add(this.showOption, {message: ""});
+              // Return to menu button
+            m_list = game.add.sprite(60, 10, 'list'); 
+            m_list.inputEnabled = true;
+            m_list.input.useHandCursor = true;
+            m_list.events.onInputDown.add(this.loadState, {state: "menu", beep: beepSound});
+            m_list.events.onInputOver.add(this.showOption, {message: words.menu_list});
+            m_list.events.onInputOut.add(this.showOption, {message: ""});
+              // Return to diffculty
+            m_back = game.add.sprite(110, 10, 'back'); 
+            m_back.inputEnabled = true;
+            m_back.input.useHandCursor = true;
+            m_back.events.onInputDown.add(this.loadState, {state: "menuSTwo", beep: beepSound});
+            m_back.events.onInputOver.add(this.showOption, {message: words.menu_back});
+            m_back.events.onInputOut.add(this.showOption, {message: ""});
+        }
+        
+        //ok and error images
+        okImg = game.add.image(game.world.centerX, game.world.centerY, 'h_ok');
+        okImg.anchor.setTo(0.5);
+        okImg.alpha = 0;
+        errorImg = game.add.image(game.world.centerX, game.world.centerY, 'h_error');
+        errorImg.anchor.setTo(0.5);
+        errorImg.alpha = 0;
+        
+        counter = 0;
+        endCounter = 100;
+        cDelay = 0;
+        eDelay = 60;
+    },
+    
+    updateCounter: function() {
+        totalTime++;
+    },
+    
+    overSquare: function(){
+        if(!clickA && this.who=="A"){
+            for(var i=0;i<sizeA;i++){
+                if(i<=this.indice){
+                    blocksA.children[i].alpha = 1;
+                }else{
+                    blocksA.children[i].alpha = 0.5;
+                }
+            }
+            fractionA.x = xA+((this.indice +1)*(blockW/sizeA))+40;
+            fractionA.alpha = 1;
+            fractionA.setText(this.indice +1);
+        }
+        if(!clickB && this.who=="B"){
+            for(var i=0;i<sizeB;i++){
+                if(i<=this.indice){
+                    blocksB.children[i].alpha = 1;
+                }else{
+                    blocksB.children[i].alpha = 0.5;
+                }
+            }
+            fractionB.x = xB+((this.indice +1)*(blockW/sizeB))+40;
+            fractionB.alpha = 1;
+            fractionB.setText(this.indice +1);
+        }
+    },
+    outSquare: function(){
+        if(!clickA && this.who=="A"){
+            for(var i=0;i<=this.indice;i++){
+                blocksA.children[i].alpha = 0.5;
+            }
+            fractionA.alpha = 0;
+        }
+        if(!clickB && this.who=="B"){
+            for(var i=0;i<=this.indice;i++){
+                blocksB.children[i].alpha = 0.5;
+            }
+            fractionB.alpha = 0;
+        }
+    },
+    
+    clickSquare: function(){
+        if(!clickA && this.who=="A"){
+            for(var i=0;i<sizeA;i++){
+                blocksA.children[i].inputEnabled = false;
+                if(i<=this.indice){
+                    blocksA.children[i].alpha = 1;
+                }else{
+                    blocksA.children[i].alpha = 0.5;
+                    auxblqA.children[i].alpha = 0;
+                }
+            }
+            labelA.alpha = 0;
+            beepSound.play();
+            clickA = true;
+            valueA = this.indice+1;
+            fractionA.x = xA+(valueA*(blockW/sizeA))+40;
+            separatorA.x = fractionA.x
+            animateA = true;
+        }
+        if(!clickB && this.who=="B"){
+            for(var i=0;i<sizeB;i++){
+                blocksB.children[i].inputEnabled = false;
+                if(i<=this.indice){
+                    blocksB.children[i].alpha = 1;
+                }else{
+                    blocksB.children[i].alpha = 0.5;
+                    auxblqB.children[i].alpha = 0;
+                }
+            }
+            labelB.alpha = 0;
+            beepSound.play();
+            clickB = true;
+            valueB = this.indice+1;
+            fractionB.x = xB+(valueB*(blockW/sizeB))+40;
+            separatorB.x = fractionB.x
+            animateB = true;
+        }
+    },
+    
+    postScore: function (){
+        
+        // ::Igor
+        var fi = 0;
+        if (result == true) { // Correct student's result:
+            hits[twoPosition - 1] ++;
+            end[twoPosition - 1] = Math.floor(Date.now()/1000);
+            conta = true;
+            if (twoPosition == 4) {
+                fi = 1;
+            }
+        } else { // Error student's result:
+            errors[twoPosition - 1] ++;
+        }
+        iterator = twoPosition;
+        sendResults(fi);
+        
+        /*var abst = "numBlocksA:"+sizeA+", valueA: " + valueA +", numBlocksB: " + sizeB + ", valueB: " + valueB;
+        
+        var hr = new XMLHttpRequest();
+        // Create some variables we need to send to our PHP file
+        var url = "resource/cn/save.php";
+        var vars = "s_ip="+hip+"&s_name="+name+"&s_lang="+lang+"&s_game="+twoShape+"&s_mode="+twoType;
+        vars += "&s_oper=Equal&s_leve="+twoDifficulty+"&s_posi="+twoPosition+"&s_resu="+result+"&s_time="+totalTime+"&s_deta="+abst;
+        
+        hr.open("POST", url, true);
+        hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+        hr.onreadystatechange = function() {
+            console.log(hr);
+
+            if(hr.readyState == 4 && hr.status == 200) {
+                var return_data = hr.responseText;
+                console.log(return_data);
+            }
+        }
+        // Send the data to PHP now... and wait for response to update the status div
+        hr.send(vars); // Actually execute the request
+        console.log("processing...");*/
+    },
+
+    update: function() {
+        
+        if(!(clickA && clickB) && !animate){
+            if(kidDirection=='right'){
+                kid.x += 1;
+                if(kid.x>=800){
+                    kidDirection='left';
+                    kid.animations.play('left', 8, true);
+                }
+            }else{
+                kid.x -= 1;
+                if(kid.x<=100){
+                    kidDirection='right';
+                    kid.animations.play('right', 8, true);
+                }
+            }
+        }
+
+        
+        if(animateA){ //If clicked A only, animate
+            for(var i=0;i<valueA;i++){
+                blocksA.children[i].y +=2;
+            }
+            if(blocksA.children[0].y>=auxblqA.children[0].y){
+                animateA = false;
+                fractionA.alpha = 1;
+                fractionA.setText(valueA+"\n"+sizeA);
+                separatorA.alpha = 1;
+            }
+        }
+        if(animateB){ //If clicked B only, animate
+            for(var i=0;i<valueB;i++){
+                blocksB.children[i].y +=2;
+            }
+            if(blocksB.children[0].y>=auxblqB.children[0].y){
+                animateB = false;
+                fractionB.alpha = 1;
+                fractionB.setText(valueB+"\n"+sizeB);
+                separatorB.alpha = 1;
+            }
+        }
+        
+        if(clickA && clickB && !this.animate){
+            //Check result
+            timer.stop();
+            cDelay++;
+            if(cDelay>=eDelay){
+                if((valueA/sizeA) == (valueB/sizeB)){
+                    result = true;
+                    twoMove = true;
+                    okSound.play();
+                    okImg.alpha = 1;
+                }else{
+                    result = false;
+                    twoMove = false;
+                    errorSound.play();
+                    kid.animations.stop();
+                    errorImg.alpha = 1;
+                }
+                this.postScore();
+                clickA = false;
+                clickB = false;
+                animate = true;
+            }
+        }
+        
+        if(animate){
+            counter++;
+            if(result){
+                kid.x += 2;
+                kidDirection='right';
+                kid.animations.play('right', 8, true);
+            }
+            if(counter>endCounter){
+                game.state.start('mapSTwo');
+            }
+        }
+    },
+  
+    //Navigation functions,
+    
+    showOption: function(){
+        m_info.text = this.message;
+    },    
+    
+    loadState: function(){
+        this.beep.play();
+        game.state.start(this.state);
+    },
+    
+    //MapLoading function
+    loadGame: function(){
+        beepSound.play();
+        if(onePosition<5){
+            game.state.start('gameSOne');
+        }else{
+            game.state.start('endSOne');
+        }
+    },
+    //Calculation help functions
+    getRndDivisor: function(number){ //Get random divisor for a number
+        var div = []; //Divisors found
+        var p = 0; //current dividor index
+        for(var i=2; i<number;i++){
+            if(number%i==0){
+                div[p] = i;
+                p++;
+            }
+        }
+        var x = game.rnd.integerInRange(0,p-1);
+        return div[x];
+    }
+    
+};
+/****************************** END ****************************/
+var endSquareTwo={
+    create: function() {  
+        
+        // Creating sound variable
+        beepSound = game.add.audio('sound_beep');
+        okSound = game.add.audio('sound_ok');
+        errorSound = game.add.audio('sound_error');
+        
+        // Reading dictionary
+        var words = game.cache.getJSON('dictionary');
+
+        // Background
+        game.add.image(0, 0, 'bgimage');
+                
+        //Clouds
+        game.add.image(300, 100, 'cloud');
+        game.add.image(660, 80, 'cloud');
+        game.add.image(110, 85, 'cloud').scale.setTo(0.8);
+        
+        // Styles for labels
+        var stylePlace = { font: '26px Arial', fill: '#400080', align: 'center'};
+        var styleLabel = { font: '26px Arial', fill: '#000080', align: 'center'};
+        var styleMenu = { font: '30px Arial', fill: '#000000', align: 'center'};
+        
+        //Floor
+        for(var i=0;i<9;i++){
+            game.add.image(i*100, 501, 'floor');
+        }
+        
+        // Progress bar
+        for(var p=1;p<=5;p++){
+            var block = game.add.image(672+(p-1)*30, 10, 'block');
+            block.scale.setTo(2, 1); //Scaling to double width
+        }
+        game.add.text(820, 10, '100%', styleMenu);
+        game.add.text(660, 10, words.difficulty + ' ' + oneDifficulty, styleMenu).anchor.setTo(1,0);
+        game.add.image(670, 10, 'pgbar');
+        
+        //School and trees
+        game.add.sprite(600, 222 , 'school').scale.setTo(0.7);
+        game.add.sprite(30, 280 , 'tree4');
+        game.add.sprite(360, 250 , 'tree2');
+        
+        //kid
+        this.kid = game.add.sprite(0, 460 , 'kid_run');
+        this.kid.anchor.setTo(0.5,0.5);
+        this.kid.scale.setTo(0.7);
+        this.kid.animations.add('walk', [0,1,2,3,4,5,6,7,8,9,10,11]);
+        this.kid.animations.play('walk', 6, true);
+    },
+
+    update: function() {
+        if(this.kid.x<=700){
+            this.kid.x += 2;
+        }else{
+            if(twoMenu){
+                // REDIRECIONAR AQUI!! ::Igor
+                if (redir == true) {
+                    this.kid.animations.stop();
+                    finish_redirect();
+                    redir = false;
+                }
+            }else{
+                this.kid.animations.stop();
+            }
+        }
+    },
+    
+    verPrincipal: function(){
+        game.state.start('welcome');
+    },
+    
+    verMenu: function(){
+        if(twoMenu){
+            game.state.start('menu');
+        }
+    }               
+};

+ 63 - 0
resource/cn/save.php

@@ -0,0 +1,63 @@
+ <?php
+
+$servername = "localhost";
+$username = "jrustler_uscore";
+$password = "12345";
+$dbname = "jrustler_fscore";
+
+// Create connection
+$conn = new mysqli($servername, $username, $password, $dbname);
+// Check connection
+if ($conn->connect_error) {
+    die("Connection failed: " . $conn->connect_error);
+}
+
+$ip = $_REQUEST["s_ip"];
+$play = $_REQUEST["s_name"];
+$date = date("Y-m-d H:i:s");
+$lang = $_REQUEST["s_lang"];
+$game = $_REQUEST["s_game"];
+$mode = $_REQUEST["s_mode"];
+$oper = $_REQUEST["s_oper"];
+$leve = $_REQUEST["s_leve"];
+$posi = $_REQUEST["s_posi"];
+$resu = $_REQUEST["s_resu"];
+$time = $_REQUEST["s_time"];
+$deta = $_REQUEST["s_deta"];
+
+
+$sql = "INSERT INTO `score`
+(`s_hostip`,
+`s_playername`,
+`s_datetime`,
+`s_lang`,
+`s_game`,
+`s_mode`,
+`s_operator`,
+`s_level`,
+`s_mappos`,
+`s_result`,
+`s_time`,
+`s_details`)
+VALUES(
+'$ip',
+'$play',
+'$date',
+'$lang',
+'$game',
+'$mode',
+'$oper',
+$leve,
+$posi,
+'$resu',
+$time,
+'$deta')";
+
+/*if ($conn->query($sql) === TRUE) {
+    echo "Grabado";
+} else {
+    echo "Error: " . $sql . "<br>" . $conn->error;
+}
+
+$conn->close();*/
+?> 

BIN
resource/fx/beep.mp3


BIN
resource/fx/beep.ogg


BIN
resource/fx/error.mp3


BIN
resource/fx/error.ogg


BIN
resource/fx/ok.mp3


BIN
resource/fx/ok.ogg


BIN
resource/img/en_US/airballoon_base.png


BIN
resource/img/en_US/airballoon_upper.png


BIN
resource/img/en_US/birch.png


BIN
resource/img/en_US/farm.png


BIN
resource/img/en_US/flag.png


BIN
resource/img/en_US/garage.png


BIN
resource/img/en_US/house.png


BIN
resource/img/en_US/kid/lost.png


BIN
resource/img/en_US/kid/run.png


BIN
resource/img/en_US/kid/walk.png


BIN
resource/img/en_US/place_a.png


BIN
resource/img/en_US/place_b.png


BIN
resource/img/en_US/rock.png


BIN
resource/img/en_US/school.png


BIN
resource/img/en_US/sign.png


BIN
resource/img/en_US/tractor/frame-0.png


BIN
resource/img/en_US/tractor/frame-1.png


BIN
resource/img/en_US/tractor/frame-2.png


BIN
resource/img/en_US/tractor/frame-3.png


BIN
resource/img/en_US/tractor/frame-4.png


BIN
resource/img/en_US/tractor/frame-5.png


BIN
resource/img/en_US/tractor/frame-6.png


BIN
resource/img/en_US/tractor/frame-7.png


BIN
resource/img/en_US/tractor/frame-8.png


BIN
resource/img/en_US/tractor/frame-9.png


BIN
resource/img/en_US/tractor/frame.png


BIN
resource/img/en_US/tree.png


BIN
resource/img/en_US/tree2.png


BIN
resource/img/en_US/tree3.png


BIN
resource/img/en_US/tree4.png


BIN
resource/img/es_PE/airballoon_base.png


BIN
resource/img/es_PE/airballoon_upper.png


BIN
resource/img/es_PE/birch.png


BIN
resource/img/es_PE/farm.png


BIN
resource/img/es_PE/flag.png


BIN
resource/img/es_PE/garage.png


BIN
resource/img/es_PE/house.png


BIN
resource/img/es_PE/kid/lost.png


BIN
resource/img/es_PE/kid/run.png


BIN
resource/img/es_PE/kid/walk.png


BIN
resource/img/es_PE/place_a.png


BIN
resource/img/es_PE/place_b.png


BIN
resource/img/es_PE/rock.png


BIN
resource/img/es_PE/school.png


BIN
resource/img/es_PE/sign.png


BIN
resource/img/es_PE/tractor/frame-0.png


BIN
resource/img/es_PE/tractor/frame-1.png


BIN
resource/img/es_PE/tractor/frame-2.png


BIN
resource/img/es_PE/tractor/frame-3.png


BIN
resource/img/es_PE/tractor/frame-4.png


BIN
resource/img/es_PE/tractor/frame-5.png


BIN
resource/img/es_PE/tractor/frame-6.png


BIN
resource/img/es_PE/tractor/frame-7.png


BIN
resource/img/es_PE/tractor/frame-8.png


BIN
resource/img/es_PE/tractor/frame-9.png


BIN
resource/img/es_PE/tractor/frame.png


BIN
resource/img/es_PE/tree.png


BIN
resource/img/es_PE/tree2.png


BIN
resource/img/es_PE/tree3.png


BIN
resource/img/es_PE/tree4.png


BIN
resource/img/flag/BRAZ.jpg


BIN
resource/img/flag/FRAN.jpg


BIN
resource/img/flag/PERU.jpg


BIN
resource/img/flag/UNST.jpg


+ 0 - 0
resource/img/fr_FR/airballoon_base.png


Some files were not shown because too many files changed in this diff