CPin.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. function CPin(iXPos, iYPos, oSprite, oPhysics, oParentContainer) {
  2. var _pStartPos;
  3. var _oPin;
  4. var _oParentContainer;
  5. var _oPhysics;
  6. var _oReflection;
  7. var _oContainer;
  8. var _fStartShadowPos = null;
  9. var _fScale = 190;
  10. var _oPosRefCast;
  11. var _oTween = null;
  12. var _oAngles;
  13. var _iStartRefRegY;
  14. var _bDown = false;
  15. var _bPlayedSound = false;
  16. this._init = function (iXPos, iYPos, oSprite) {
  17. _oContainer = new createjs.Container();
  18. _oParentContainer.addChild(_oContainer);
  19. _oPin = this.createPin(iXPos, iYPos, oSprite);
  20. _oReflection = this.createPin(iXPos, iYPos, oSprite);
  21. _oReflection.scaleY = -1;
  22. _iStartRefRegY = _oReflection.regY += PIN_REF_REGY_FACTOR + 0.5;
  23. this.scale(_fScale);
  24. _oAngles = new CANNON.Vec3();
  25. _oContainer.addChild(_oReflection, _oPin);
  26. };
  27. this.createPin = function () {
  28. var oPin;
  29. var oData = {
  30. images: [oSprite],
  31. // width, height & registration point of each sprite
  32. frames: {width: oSprite.width / 10, height: oSprite.height / 8, regX: (oSprite.width / 10) / 2, regY: (oSprite.height / 8) / 2}
  33. };
  34. var oSpriteSheet = new createjs.SpriteSheet(oData);
  35. oPin = createSprite(oSpriteSheet, 0, (oSprite.width / 10) / 2, (oSprite.height / 8) / 2, oSprite.width / 10, oSprite.height / 8);
  36. oPin.stop();
  37. oPin.x = iXPos;
  38. oPin.y = iYPos;
  39. return oPin;
  40. };
  41. this.setStartPos = function (iX, iY) {
  42. _pStartPos = {x: iX, y: iY};
  43. };
  44. this.getStartPos = function () {
  45. return _pStartPos;
  46. };
  47. this.resetState = function () {
  48. _oPin.gotoAndStop(0);
  49. this.setPosition(_pStartPos.x, _pStartPos.y);
  50. _oContainer.alpha = 1;
  51. };
  52. this.isDownYet = function () {
  53. return _bDown;
  54. };
  55. this.setDown = function (bVal) {
  56. _bDown = bVal;
  57. if (bVal) {
  58. createjs.Tween.get(this).wait(750).call(function () {
  59. s_oScenario.setElementVelocity(_oPhysics, {x: 0, y: 0, z: 0});
  60. });
  61. }
  62. };
  63. this.animReposition = function (iY, fAlpha) {
  64. createjs.Tween.get(_oPin).to({y: iY}, 500);
  65. createjs.Tween.get(_oReflection).wait(250).to({alpha: fAlpha}, 200);
  66. };
  67. this.animTake = function (iY) {
  68. createjs.Tween.get(_oPin).to({y: iY}, 500).call(function () {
  69. _oContainer.visible = false;
  70. });
  71. createjs.Tween.get(_oReflection).to({alpha: 0}, 200);
  72. };
  73. this.unload = function () {
  74. _oParentContainer.removeChild(_oContainer);
  75. };
  76. this.startPosShadowY = function (fYPos) {
  77. _fStartShadowPos = fYPos;
  78. };
  79. this.getStartShadowYPos = function () {
  80. return _fStartShadowPos;
  81. };
  82. this.tweenFade = function (fVal, iTime, iWait) {
  83. _oTween = createjs.Tween.get(_oContainer).wait(iWait).to({alpha: fVal}, iTime).call(function () {
  84. _oTween = null;
  85. });
  86. };
  87. this.playAudio = function () {
  88. if (_bPlayedSound) {
  89. return;
  90. }
  91. playSound("pin_hitted", 1, false);
  92. _bPlayedSound = true;
  93. };
  94. this.setPlayedSound = function (bVal) {
  95. _bPlayedSound = bVal;
  96. };
  97. this.pinRotation = function () {
  98. _oPhysics.quaternion.y = 0;
  99. _oPhysics.quaternion.toEuler(_oAngles);
  100. _oPhysics.shapes[0].getAveragePointLocal(_oAngles);
  101. _oAngles.x = Math.round(Math.degrees(_oAngles.x * 2));
  102. _oAngles.y = Math.round(Math.degrees(_oAngles.y * 2));
  103. _oAngles.z = Math.round(Math.degrees(_oAngles.z * 2));
  104. if (_oAngles.x === 0) {
  105. _oPin.gotoAndStop(0);
  106. _oReflection.gotoAndStop(0);
  107. } else if (_oAngles.y <= 9 && _oAngles.y > 7 || _oAngles.y > -9 && _oAngles.y < -7) {
  108. if (_oAngles.x >= -2 && _oAngles.x <= 3) {
  109. _oPin.gotoAndStop(29);
  110. } else if (_oAngles.x >= 4 && _oAngles.x <= 7) {
  111. _oPin.gotoAndStop(19);
  112. } else if (_oAngles.x >= 8 && _oAngles.x <= 12) {
  113. _oPin.gotoAndStop(9);
  114. } else if (_oAngles.x >= 13 && _oAngles.x <= 15) {
  115. _oPin.gotoAndStop(79);
  116. } else if (_oAngles.x >= 16 && _oAngles.x <= 18 || _oAngles.x <= -16 && _oAngles.x >= -18) {
  117. _oPin.gotoAndStop(69);
  118. } else if (_oAngles.x >= -15 && _oAngles.x <= -12) {
  119. _oPin.gotoAndStop(59);
  120. } else if (_oAngles.x >= -11 && _oAngles.x <= -6) {
  121. _oPin.gotoAndStop(49);
  122. } else if (_oAngles.x >= -5 && _oAngles.x <= -2) {
  123. _oPin.gotoAndStop(39);
  124. }
  125. } else if (_oAngles.z >= -3 && _oAngles.z <= 3) {
  126. if (_oAngles.y >= -8 && _oAngles.y <= 8) {
  127. if (_oAngles.x === 0) {
  128. _oPin.gotoAndStop(0);
  129. } else if (_oAngles.x === 1) {
  130. _oPin.gotoAndStop(1);
  131. } else if (_oAngles.x === 2) {
  132. _oPin.gotoAndStop(2);
  133. } else if (_oAngles.x === 3) {
  134. _oPin.gotoAndStop(3);
  135. } else if (_oAngles.x === 4) {
  136. _oPin.gotoAndStop(4);
  137. } else if (_oAngles.x === 5) {
  138. _oPin.gotoAndStop(5);
  139. } else if (_oAngles.x === 6) {
  140. _oPin.gotoAndStop(6);
  141. } else if (_oAngles.x === 7) {
  142. _oPin.gotoAndStop(7);
  143. } else if (_oAngles.x === 8) {
  144. _oPin.gotoAndStop(8);
  145. } else if (_oAngles.x === 9) {
  146. _oPin.gotoAndStop(9);
  147. } else if (_oAngles.x === -1) {
  148. _oPin.gotoAndStop(41);
  149. } else if (_oAngles.x === -2) {
  150. _oPin.gotoAndStop(42);
  151. } else if (_oAngles.x === -3) {
  152. _oPin.gotoAndStop(43);
  153. } else if (_oAngles.x === -4) {
  154. _oPin.gotoAndStop(44);
  155. } else if (_oAngles.x === -5) {
  156. _oPin.gotoAndStop(45);
  157. } else if (_oAngles.x === -6) {
  158. _oPin.gotoAndStop(46);
  159. } else if (_oAngles.x === -7) {
  160. _oPin.gotoAndStop(47);
  161. } else if (_oAngles.x === -8) {
  162. _oPin.gotoAndStop(48);
  163. } else if (_oAngles.x === -9) {
  164. _oPin.gotoAndStop(49);
  165. }
  166. } else if (_oAngles.y <= -8 && _oAngles.y >= -18 || _oAngles.y <= 18 && _oAngles.y >= 11) {
  167. if (_oAngles.x === 0) {
  168. _oPin.gotoAndStop(0);
  169. } else if (_oAngles.x === 1) {
  170. _oPin.gotoAndStop(41);
  171. } else if (_oAngles.x === 2) {
  172. _oPin.gotoAndStop(42);
  173. } else if (_oAngles.x === 3) {
  174. _oPin.gotoAndStop(43);
  175. } else if (_oAngles.x === 4) {
  176. _oPin.gotoAndStop(44);
  177. } else if (_oAngles.x === 5) {
  178. _oPin.gotoAndStop(45);
  179. } else if (_oAngles.x === 6) {
  180. _oPin.gotoAndStop(46);
  181. } else if (_oAngles.x === 7) {
  182. _oPin.gotoAndStop(47);
  183. } else if (_oAngles.x === 8) {
  184. _oPin.gotoAndStop(48);
  185. } else if (_oAngles.x === 9) {
  186. _oPin.gotoAndStop(49);
  187. } else if (_oAngles.x === -1) {
  188. _oPin.gotoAndStop(1);
  189. } else if (_oAngles.x === -2) {
  190. _oPin.gotoAndStop(2);
  191. } else if (_oAngles.x === -3) {
  192. _oPin.gotoAndStop(3);
  193. } else if (_oAngles.x === -4) {
  194. _oPin.gotoAndStop(4);
  195. } else if (_oAngles.x === -5) {
  196. _oPin.gotoAndStop(5);
  197. } else if (_oAngles.x === -6) {
  198. _oPin.gotoAndStop(6);
  199. } else if (_oAngles.x === -7) {
  200. _oPin.gotoAndStop(7);
  201. } else if (_oAngles.x === -8) {
  202. _oPin.gotoAndStop(8);
  203. } else if (_oAngles.x === -9) {
  204. _oPin.gotoAndStop(9);
  205. }
  206. }
  207. } else if (_oAngles.z >= 4 && _oAngles.z <= 7) {
  208. if (_oAngles.y >= -8 && _oAngles.y <= 8) {
  209. if (_oAngles.x === 0) {
  210. _oPin.gotoAndStop(10);
  211. } else if (_oAngles.x === 1) {
  212. _oPin.gotoAndStop(11);
  213. } else if (_oAngles.x === 2) {
  214. _oPin.gotoAndStop(12);
  215. } else if (_oAngles.x === 3) {
  216. _oPin.gotoAndStop(13);
  217. } else if (_oAngles.x === 4) {
  218. _oPin.gotoAndStop(14);
  219. } else if (_oAngles.x === 5) {
  220. _oPin.gotoAndStop(15);
  221. } else if (_oAngles.x === 6) {
  222. _oPin.gotoAndStop(16);
  223. } else if (_oAngles.x === 7) {
  224. _oPin.gotoAndStop(17);
  225. } else if (_oAngles.x === 8) {
  226. _oPin.gotoAndStop(18);
  227. } else if (_oAngles.x === 9) {
  228. _oPin.gotoAndStop(19);
  229. } else if (_oAngles.x === -1) {
  230. _oPin.gotoAndStop(51);
  231. } else if (_oAngles.x === -2) {
  232. _oPin.gotoAndStop(52);
  233. } else if (_oAngles.x === -3) {
  234. _oPin.gotoAndStop(53);
  235. } else if (_oAngles.x === -4) {
  236. _oPin.gotoAndStop(54);
  237. } else if (_oAngles.x === -5) {
  238. _oPin.gotoAndStop(55);
  239. } else if (_oAngles.x === -6) {
  240. _oPin.gotoAndStop(56);
  241. } else if (_oAngles.x === -7) {
  242. _oPin.gotoAndStop(57);
  243. } else if (_oAngles.x === -8) {
  244. _oPin.gotoAndStop(58);
  245. } else if (_oAngles.x === -9) {
  246. _oPin.gotoAndStop(59);
  247. }
  248. } else if (_oAngles.y <= -8 && _oAngles.y >= -18 || _oAngles.y <= 18 && _oAngles.y >= 10) {
  249. if (_oAngles.x === 0) {
  250. _oPin.gotoAndStop(0);
  251. } else if (_oAngles.x === 1) {
  252. _oPin.gotoAndStop(31);
  253. } else if (_oAngles.x === 2) {
  254. _oPin.gotoAndStop(32);
  255. } else if (_oAngles.x === 3) {
  256. _oPin.gotoAndStop(33);
  257. } else if (_oAngles.x === 4) {
  258. _oPin.gotoAndStop(34);
  259. } else if (_oAngles.x === 5) {
  260. _oPin.gotoAndStop(35);
  261. } else if (_oAngles.x === 6) {
  262. _oPin.gotoAndStop(36);
  263. } else if (_oAngles.x === 7) {
  264. _oPin.gotoAndStop(37);
  265. } else if (_oAngles.x === 8) {
  266. _oPin.gotoAndStop(38);
  267. } else if (_oAngles.x === 9) {
  268. _oPin.gotoAndStop(39);
  269. } else if (_oAngles.x === -1) {
  270. _oPin.gotoAndStop(71);
  271. } else if (_oAngles.x === -2) {
  272. _oPin.gotoAndStop(72);
  273. } else if (_oAngles.x === -3) {
  274. _oPin.gotoAndStop(73);
  275. } else if (_oAngles.x === -4) {
  276. _oPin.gotoAndStop(74);
  277. } else if (_oAngles.x === -5) {
  278. _oPin.gotoAndStop(75);
  279. } else if (_oAngles.x === -6) {
  280. _oPin.gotoAndStop(76);
  281. } else if (_oAngles.x === -7) {
  282. _oPin.gotoAndStop(77);
  283. } else if (_oAngles.x === -8) {
  284. _oPin.gotoAndStop(78);
  285. } else if (_oAngles.x === -9) {
  286. _oPin.gotoAndStop(79);
  287. }
  288. }
  289. } else if (_oAngles.z >= 8 && _oAngles.z <= 10) {
  290. if (_oAngles.x === 0) {
  291. _oPin.gotoAndStop(20);
  292. } else if (_oAngles.x === 1) {
  293. _oPin.gotoAndStop(21);
  294. } else if (_oAngles.x === 2) {
  295. _oPin.gotoAndStop(22);
  296. } else if (_oAngles.x === 3) {
  297. _oPin.gotoAndStop(23);
  298. } else if (_oAngles.x === 4) {
  299. _oPin.gotoAndStop(24);
  300. } else if (_oAngles.x === 5) {
  301. _oPin.gotoAndStop(25);
  302. } else if (_oAngles.x === 6) {
  303. _oPin.gotoAndStop(26);
  304. } else if (_oAngles.x === 7) {
  305. _oPin.gotoAndStop(27);
  306. } else if (_oAngles.x === 8) {
  307. _oPin.gotoAndStop(28);
  308. } else if (_oAngles.x === 9) {
  309. _oPin.gotoAndStop(29);
  310. } else if (_oAngles.x === -1) {
  311. _oPin.gotoAndStop(61);
  312. } else if (_oAngles.x === -2) {
  313. _oPin.gotoAndStop(62);
  314. } else if (_oAngles.x === -3) {
  315. _oPin.gotoAndStop(63);
  316. } else if (_oAngles.x === -4) {
  317. _oPin.gotoAndStop(64);
  318. } else if (_oAngles.x === -5) {
  319. _oPin.gotoAndStop(65);
  320. } else if (_oAngles.x === -6) {
  321. _oPin.gotoAndStop(66);
  322. } else if (_oAngles.x === -7) {
  323. _oPin.gotoAndStop(67);
  324. } else if (_oAngles.x === -8) {
  325. _oPin.gotoAndStop(68);
  326. } else if (_oAngles.x === -9) {
  327. _oPin.gotoAndStop(69);
  328. }
  329. } else if (_oAngles.z <= -4 && _oAngles.z >= -7) {
  330. if (_oAngles.y >= -10 && _oAngles.y <= 10) {
  331. if (_oAngles.x === 0) {
  332. _oPin.gotoAndStop(70);
  333. } else if (_oAngles.x === 1) {
  334. _oPin.gotoAndStop(71);
  335. } else if (_oAngles.x === 2) {
  336. _oPin.gotoAndStop(72);
  337. } else if (_oAngles.x === 3) {
  338. _oPin.gotoAndStop(73);
  339. } else if (_oAngles.x === 4) {
  340. _oPin.gotoAndStop(74);
  341. } else if (_oAngles.x === 5) {
  342. _oPin.gotoAndStop(75);
  343. } else if (_oAngles.x === 6) {
  344. _oPin.gotoAndStop(76);
  345. } else if (_oAngles.x === 7) {
  346. _oPin.gotoAndStop(77);
  347. } else if (_oAngles.x === 8) {
  348. _oPin.gotoAndStop(78);
  349. } else if (_oAngles.x === 9) {
  350. _oPin.gotoAndStop(79);
  351. } else if (_oAngles.x === -1) {
  352. _oPin.gotoAndStop(31);
  353. } else if (_oAngles.x === -2) {
  354. _oPin.gotoAndStop(32);
  355. } else if (_oAngles.x === -3) {
  356. _oPin.gotoAndStop(33);
  357. } else if (_oAngles.x === -4) {
  358. _oPin.gotoAndStop(34);
  359. } else if (_oAngles.x === -5) {
  360. _oPin.gotoAndStop(35);
  361. } else if (_oAngles.x === -6) {
  362. _oPin.gotoAndStop(36);
  363. } else if (_oAngles.x === -7) {
  364. _oPin.gotoAndStop(37);
  365. } else if (_oAngles.x === -8) {
  366. _oPin.gotoAndStop(38);
  367. } else if (_oAngles.x === -9) {
  368. _oPin.gotoAndStop(39);
  369. }
  370. } else if (_oAngles.y <= -11 && _oAngles.y >= -18 || _oAngles.y <= 18 && _oAngles.y >= 11) {
  371. if (_oAngles.x === 0) {
  372. _oPin.gotoAndStop(50);
  373. } else if (_oAngles.x === 1) {
  374. _oPin.gotoAndStop(51);
  375. } else if (_oAngles.x === 2) {
  376. _oPin.gotoAndStop(52);
  377. } else if (_oAngles.x === 3) {
  378. _oPin.gotoAndStop(53);
  379. } else if (_oAngles.x === 4) {
  380. _oPin.gotoAndStop(54);
  381. } else if (_oAngles.x === 5) {
  382. _oPin.gotoAndStop(55);
  383. } else if (_oAngles.x === 6) {
  384. _oPin.gotoAndStop(56);
  385. } else if (_oAngles.x === 7) {
  386. _oPin.gotoAndStop(57);
  387. } else if (_oAngles.x === 8) {
  388. _oPin.gotoAndStop(58);
  389. } else if (_oAngles.x === 9) {
  390. _oPin.gotoAndStop(59);
  391. } else if (_oAngles.x === -1) {
  392. _oPin.gotoAndStop(11);
  393. } else if (_oAngles.x === -2) {
  394. _oPin.gotoAndStop(12);
  395. } else if (_oAngles.x === -3) {
  396. _oPin.gotoAndStop(13);
  397. } else if (_oAngles.x === -4) {
  398. _oPin.gotoAndStop(14);
  399. } else if (_oAngles.x === -5) {
  400. _oPin.gotoAndStop(15);
  401. } else if (_oAngles.x === -6) {
  402. _oPin.gotoAndStop(16);
  403. } else if (_oAngles.x === -7) {
  404. _oPin.gotoAndStop(17);
  405. } else if (_oAngles.x === -8) {
  406. _oPin.gotoAndStop(18);
  407. } else if (_oAngles.x === -9) {
  408. _oPin.gotoAndStop(19);
  409. }
  410. }
  411. } else if (_oAngles.z === -8) {
  412. if (_oAngles.x === 0) {
  413. _oPin.gotoAndStop(60);
  414. } else if (_oAngles.x === 1) {
  415. _oPin.gotoAndStop(61);
  416. } else if (_oAngles.x === 2) {
  417. _oPin.gotoAndStop(62);
  418. } else if (_oAngles.x === 3) {
  419. _oPin.gotoAndStop(63);
  420. } else if (_oAngles.x === 4) {
  421. _oPin.gotoAndStop(64);
  422. } else if (_oAngles.x === 5) {
  423. _oPin.gotoAndStop(65);
  424. } else if (_oAngles.x === 6) {
  425. _oPin.gotoAndStop(66);
  426. } else if (_oAngles.x === 7) {
  427. _oPin.gotoAndStop(67);
  428. } else if (_oAngles.x === 8) {
  429. _oPin.gotoAndStop(68);
  430. } else if (_oAngles.x === 9) {
  431. _oPin.gotoAndStop(69);
  432. } else if (_oAngles.x === -1) {
  433. _oPin.gotoAndStop(21);
  434. } else if (_oAngles.x === -2) {
  435. _oPin.gotoAndStop(22);
  436. } else if (_oAngles.x === -3) {
  437. _oPin.gotoAndStop(23);
  438. } else if (_oAngles.x === -4) {
  439. _oPin.gotoAndStop(24);
  440. } else if (_oAngles.x === -5) {
  441. _oPin.gotoAndStop(25);
  442. } else if (_oAngles.x === -6) {
  443. _oPin.gotoAndStop(26);
  444. } else if (_oAngles.x === -7) {
  445. _oPin.gotoAndStop(27);
  446. } else if (_oAngles.x === -8) {
  447. _oPin.gotoAndStop(28);
  448. } else if (_oAngles.x === -9) {
  449. _oPin.gotoAndStop(29);
  450. }
  451. }
  452. _oReflection.gotoAndStop(_oPin.currentFrame);
  453. };
  454. this.getPosRef = function () {
  455. return _oPosRefCast;
  456. };
  457. this.setPosRef = function (iZPos) {
  458. _oPosRefCast = iZPos;
  459. };
  460. this.setRegYRef = function (iY) {
  461. _oReflection.regY = iY;
  462. };
  463. this.getRegYRef = function () {
  464. return _iStartRefRegY;
  465. };
  466. this.setPositionReflection = function (iX, iY) {
  467. _oReflection.x = iX;
  468. _oReflection.y = iY;
  469. };
  470. this.setPosition = function (iXPos, iYPos) {
  471. _oPin.x = iXPos;
  472. _oPin.y = iYPos;
  473. };
  474. this.getPhysics = function () {
  475. return _oPhysics;
  476. };
  477. this.setAlpha = function (fVal) {
  478. _oContainer.alpha = fVal;
  479. };
  480. this.setAngle = function (iAngle) {
  481. _oPin.rotation = iAngle;
  482. };
  483. this.setVisible = function (bVal) {
  484. _oContainer.visible = bVal;
  485. };
  486. this.setVisibleRef = function (bVal) {
  487. _oReflection.visible = bVal;
  488. };
  489. this.getVisible = function () {
  490. return _oContainer.visible;
  491. };
  492. this.isVisibleRef = function () {
  493. return _oReflection.visible;
  494. };
  495. this.getX = function () {
  496. return _oPin.x;
  497. };
  498. this.getY = function () {
  499. return _oPin.y;
  500. };
  501. this.getStartScale = function () {
  502. return _fScale;
  503. };
  504. this.scale = function (fValue) {
  505. _oPin.scaleX = fValue;
  506. _oPin.scaleY = fValue;
  507. _oReflection.scaleX = fValue;
  508. _oReflection.scaleY = -fValue;
  509. };
  510. this.setAlphaByHeight = function (fHeight) {
  511. _oReflection.alpha = fHeight;
  512. };
  513. this.getAlphaRef = function () {
  514. return _oReflection.alpha;
  515. };
  516. this.getScale = function () {
  517. return _oPin.scaleX;
  518. };
  519. this.getObject = function () {
  520. return _oContainer;
  521. };
  522. this.getDepthPos = function () {
  523. return _oPhysics.position.y;
  524. };
  525. _oPhysics = oPhysics;
  526. _oParentContainer = oParentContainer;
  527. this._init(iXPos, iYPos, oSprite);
  528. return this;
  529. }