CFruitSettings.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. function CFruitSettings(){
  2. this._init = function(){
  3. s_aFruitSpriteSheet = new Array();
  4. s_aFruitSize = new Array();
  5. s_aFruitSpeed = new Array();
  6. s_aFruitColors = new Array();
  7. s_aFruitScore = new Array();
  8. s_aFruitSpliceSound = new Array();
  9. //FIRST FRUIT
  10. var oSprite = s_oSpriteLibrary.getSprite('fruit_0');
  11. var oData = { // image to use
  12. framerate : 8,
  13. images: [oSprite],
  14. // width, height & registration point of each sprite
  15. frames: {width: 90, height: 103, regX: 45, regY: 51},
  16. animations: { idle:[0],slice_1:[1],slice_2:[2],slice_3:[3],slice_4:[4],slice_5:[5],slice_6:[6],slice_7:[7],slice_8:[8]}
  17. };
  18. s_aFruitSpriteSheet[0] = new createjs.SpriteSheet(oData);
  19. s_aFruitSize[0] = {width:90,height:103,regX:45,regY:51};
  20. s_aFruitSpeed[0] = 20;
  21. s_aFruitColors[0] = "#fdc06f";
  22. s_aFruitScore[0] = 20;
  23. s_aFruitSpliceSound[0] = "fruit_slice_2";
  24. //SECOND FRUIT
  25. oSprite = s_oSpriteLibrary.getSprite('fruit_1');
  26. oData = { // image to use
  27. framerate : 8,
  28. images: [oSprite],
  29. // width, height & registration point of each sprite
  30. frames: {width: 90, height: 103, regX: 45, regY: 51},
  31. animations: { idle:[0],slice_1:[1],slice_2:[2],slice_3:[3],slice_4:[4],slice_5:[5],slice_6:[6],slice_7:[7],slice_8:[8]}
  32. };
  33. s_aFruitSpriteSheet[1] = new createjs.SpriteSheet(oData);
  34. s_aFruitSize[1] = {width:90,height:103,regX:45,regY:51};
  35. s_aFruitSpeed[1] = 24;
  36. s_aFruitColors[1] = "#cc0001";
  37. s_aFruitScore[1] = 30;
  38. s_aFruitSpliceSound[1] = "fruit_slice_1";
  39. //THIRD FRUIT
  40. oSprite = s_oSpriteLibrary.getSprite('fruit_2');
  41. oData = { // image to use
  42. framerate : 8,
  43. images: [oSprite],
  44. // width, height & registration point of each sprite
  45. frames: {width: 100, height: 122, regX: 50, regY: 61},
  46. animations: { idle:[0],slice_1:[1],slice_2:[2],slice_3:[3],slice_4:[4],slice_5:[5],slice_6:[6],slice_7:[7],slice_8:[8]}
  47. };
  48. s_aFruitSpriteSheet[2] = new createjs.SpriteSheet(oData);
  49. s_aFruitSize[2] = {width:100,height:122,regX:50,regY:61};
  50. s_aFruitSpeed[2] = 24;
  51. s_aFruitColors[2] = "#74542d";
  52. s_aFruitScore[2] = 40;
  53. s_aFruitSpliceSound[2] = "fruit_slice_1";
  54. //FOURTH FRUIT
  55. oSprite = s_oSpriteLibrary.getSprite('fruit_3');
  56. oData = { // image to use
  57. framerate : 8,
  58. images: [oSprite],
  59. // width, height & registration point of each sprite
  60. frames: {width: 87, height: 90, regX: 43, regY: 45},
  61. animations: { idle:[0],slice_1:[1],slice_2:[2],slice_3:[3],slice_4:[4],slice_5:[5],slice_6:[6],slice_7:[7],slice_8:[8]}
  62. };
  63. s_aFruitSpriteSheet[3] = new createjs.SpriteSheet(oData);
  64. s_aFruitSize[3] = {width:87,height:90,regX:43,regY:45};
  65. s_aFruitSpeed[3] = 18;
  66. s_aFruitColors[3] = "#fd6909";
  67. s_aFruitScore[3] = 30;
  68. s_aFruitSpliceSound[3] = "fruit_slice_3";
  69. //FIFTH FRUIT
  70. oSprite = s_oSpriteLibrary.getSprite('fruit_4');
  71. oData = { // image to use
  72. framerate : 8,
  73. images: [oSprite],
  74. // width, height & registration point of each sprite
  75. frames: {width: 83, height: 105, regX: 41, regY: 52},
  76. animations: { idle:[0],slice_1:[1],slice_2:[2],slice_3:[3],slice_4:[4],slice_5:[5],slice_6:[6],slice_7:[7],slice_8:[8]}
  77. };
  78. s_aFruitSpriteSheet[4] = new createjs.SpriteSheet(oData);
  79. s_aFruitSize[4] = {width:83,height:105,regX:41,regY:52};
  80. s_aFruitSpeed[4] = 18;
  81. s_aFruitColors[4] = "#e8e570";
  82. s_aFruitScore[4] = 30;
  83. s_aFruitSpliceSound[4] = "fruit_slice_1";
  84. //SIXTH FRUIT
  85. oSprite = s_oSpriteLibrary.getSprite('fruit_5');
  86. oData = { // image to use
  87. framerate : 8,
  88. images: [oSprite],
  89. // width, height & registration point of each sprite
  90. frames: {width: 200, height: 200, regX: 100, regY: 100},
  91. animations: { idle:[0],slice_1:[1],slice_2:[2],slice_3:[3],slice_4:[4],slice_5:[5],slice_6:[6],slice_7:[7],slice_8:[8]}
  92. };
  93. s_aFruitSpriteSheet[5] = new createjs.SpriteSheet(oData);
  94. s_aFruitSize[5] = {width:200,height:200,regX:100,regY:100};
  95. s_aFruitSpeed[5] = 18;
  96. s_aFruitColors[5] = "#6da818";
  97. s_aFruitScore[5] = 10;
  98. s_aFruitSpliceSound[5] = "fruit_slice_3";
  99. //BOMB
  100. oSprite = s_oSpriteLibrary.getSprite('bomb');
  101. oData = { // image to use
  102. framerate : 10,
  103. images: [oSprite],
  104. // width, height & registration point of each sprite
  105. frames: {width: 150, height: 150},
  106. animations: { idle:[0,1,"idle"]}
  107. };
  108. s_aFruitSpriteSheet[6] = new createjs.SpriteSheet(oData);
  109. s_aFruitSize[6] = {width:150,height:150,regX:0,regY:0};
  110. s_aFruitSpeed[6] = 20;
  111. s_aFruitColors[6] = "#fff";
  112. s_aFruitScore[6] = 0;
  113. s_aFruitSpliceSound[6] = "explosion";
  114. };
  115. this._init();
  116. }
  117. var s_aFruitSpriteSheet;
  118. var s_aFruitSize;
  119. var s_aFruitSpeed;
  120. var s_aFruitColors;
  121. var s_aFruitScore;
  122. var s_aFruitSpliceSound;