Advertisement
Enter212

SNAKE 3D

Apr 15th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.35 KB | None | 0 0
  1. // GAME.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <irrlicht.h>
  6. #include <iostream>
  7. #include <windows.h>
  8. #include <conio.h>
  9. #include <windef.h>
  10. #include "fstream"
  11. #include "string"
  12. #include "vector"
  13. #include <sstream>
  14. #include <cstdlib>
  15. #include <time.h>
  16.  
  17.  
  18. using namespace std;
  19. using namespace irr;
  20.  
  21. using namespace core;
  22. using namespace scene;
  23. using namespace video;
  24. using namespace io;
  25. using namespace gui;
  26.  
  27. enum
  28. {
  29. ID_IsNotPickable = 0,
  30. IDFlag_IsPickable = 1 << 0,
  31. IDFlag_IsHighlightable = 1 << 1
  32. };
  33.  
  34. int main()
  35. {
  36. scene::IMeshSceneNode* n1 = 0;
  37. scene::IMeshSceneNode* n2 = 0;
  38. scene::IMeshSceneNode* n3 = 0;
  39. scene::IMeshSceneNode* n4 = 0;
  40. scene::IMeshSceneNode* n5 = 0;
  41. scene::IMeshSceneNode* n6 = 0;
  42. scene::IMeshSceneNode* n7 = 0;
  43. scene::IMeshSceneNode* n8 = 0;
  44. scene::IMeshSceneNode* n9= 0;
  45. scene::IMeshSceneNode* n10 = 0;
  46. scene::IMeshSceneNode* n11 = 0;
  47. scene::IMeshSceneNode* n12 = 0;
  48. scene::IMeshSceneNode* n13 = 0;
  49. scene::IMeshSceneNode* n14 = 0;
  50. scene::IMeshSceneNode* n15 = 0;
  51. scene::IMeshSceneNode* n16 = 0;
  52. scene::IMeshSceneNode* n17 = 0;
  53. scene::IMeshSceneNode* n18 = 0;
  54. scene::IMeshSceneNode* n19 = 0;
  55. scene::IMeshSceneNode* n20 = 0;
  56. scene::IMeshSceneNode* b1 = 0;
  57. scene::IMeshSceneNode* b2 = 0;
  58. scene::IMeshSceneNode* b3 = 0;
  59. scene::IMeshSceneNode* b4 = 0;
  60. int loop=0;
  61. int ct=1;
  62. bool n1e=false;
  63. double xx=100;
  64. double yy=85;
  65. bool collision=false;
  66. srand( time( NULL ) );
  67. double ix = rand()%100;
  68. double iy = rand()%150;
  69. double x = 100;
  70. double y = 85;
  71. double x1 = 500;
  72. double x2 = 500;
  73. double x3 = 500;
  74. double x4 = 500;
  75. double x5 = 500;
  76. double x6 = 500;
  77. double x7 = 500;
  78. double x8 = 500;
  79. double x9 = 500;
  80. double x10 = 500;
  81. double x11 = 500;
  82. double x12 = 500;
  83. double x13 = 500;
  84. double x14 = 500;
  85. double x15 = 500;
  86. double x16 = 500;
  87. double x17 = 500;
  88. double x18 = 500;
  89. double x19 = 500;
  90. double x20 = 500;
  91. double y1 = 500;
  92. double y2 = 500;
  93. double y3 = 500;
  94. double y4 = 500;
  95. double y5 = 500;
  96. double y6 = 500;
  97. double y7 = 500;
  98. double y8 = 500;
  99. double y9 = 500;
  100. double y10 = 500;
  101. double y11 = 500;
  102. double y12 = 500;
  103. double y13 = 500;
  104. double y14 = 500;
  105. double y15 = 500;
  106. double y16 = 500;
  107. double y17 = 500;
  108. double y18 = 500;
  109. double y19 = 500;
  110. double y20 = 500;
  111. bool go=false;
  112.  
  113. int dir = 2;
  114. bool mouse=false;
  115. core::stringw title = "SNAKE 3D";
  116. IrrlichtDevice *device =
  117. createDevice(EDT_DIRECT3D9, dimension2d<u32>(640, 480), 16,
  118. false, true, true, 0);
  119. IVideoDriver* driver = device->getVideoDriver();
  120. ISceneManager* smgr = device->getSceneManager();
  121. IGUIEnvironment* guienv = device->getGUIEnvironment();
  122. int score = 0;
  123. core::stringw str = L"";
  124. str += title;
  125. str +=" [ Score: ";
  126. str += score;
  127. str += " ]";
  128.  
  129. device->setWindowCaption(str.c_str());
  130.  
  131. scene::IAnimatedMesh* nn1 = smgr->getMesh("../../media/tail.obj");
  132. //TAIL
  133. n1 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  134. n1->setScale(core::vector3df(5, 5, 5));
  135. n1->setPosition(core::vector3df(500,0,500));
  136. n2 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  137. n2->setScale(core::vector3df(5, 5, 5));
  138. n2->setPosition(core::vector3df(500,0,500));
  139. n3 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  140. n3->setScale(core::vector3df(5, 5, 5));
  141. n3->setPosition(core::vector3df(500,0,500));
  142. n4 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  143. n4->setScale(core::vector3df(5, 5, 5));
  144. n4->setPosition(core::vector3df(500,0,500));
  145. n5 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  146. n5->setScale(core::vector3df(5, 5, 5));
  147. n5->setPosition(core::vector3df(500,0,500));
  148. n6 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  149. n6->setScale(core::vector3df(5, 5, 5));
  150. n6->setPosition(core::vector3df(500,0,500));
  151. n7 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  152. n7->setScale(core::vector3df(5, 5, 5));
  153. n7->setPosition(core::vector3df(500,0,500));
  154. n8 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  155. n8->setScale(core::vector3df(5, 5, 5));
  156. n8->setPosition(core::vector3df(500,0,500));
  157. n9 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  158. n9->setScale(core::vector3df(5, 5, 5));
  159. n9->setPosition(core::vector3df(500,0,500));
  160. n10 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  161. n10->setScale(core::vector3df(5, 5, 5));
  162. n10->setPosition(core::vector3df(500,0,500));
  163. n11 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  164. n11->setScale(core::vector3df(5, 5, 5));
  165. n11->setPosition(core::vector3df(500,0,500));
  166. n12 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  167. n12->setScale(core::vector3df(5, 5, 5));
  168. n12->setPosition(core::vector3df(500,0,500));
  169. n13 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  170. n13->setScale(core::vector3df(5, 5, 5));
  171. n13->setPosition(core::vector3df(500,0,500));
  172. n14 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  173. n14->setScale(core::vector3df(5, 5, 5));
  174. n14->setPosition(core::vector3df(500,0,500));
  175. n15 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  176. n15->setScale(core::vector3df(5, 5, 5));
  177. n15->setPosition(core::vector3df(500,0,500));
  178. n16 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  179. n16->setScale(core::vector3df(5, 5, 5));
  180. n16->setPosition(core::vector3df(500,0,500));
  181. n17 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  182. n17->setScale(core::vector3df(5, 5, 5));
  183. n17->setPosition(core::vector3df(500,0,500));
  184. n18 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  185. n18->setScale(core::vector3df(5, 5, 5));
  186. n18->setPosition(core::vector3df(500,0,500));
  187. n19 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  188. n19->setScale(core::vector3df(5, 5, 5));
  189. n19->setPosition(core::vector3df(500,0,500));
  190. n20 = smgr->addOctreeSceneNode(nn1->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  191. n20->setScale(core::vector3df(5, 5, 5));
  192. n20->setPosition(core::vector3df(500,0,500));
  193. n1->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  194. n2->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  195. n3->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  196. n4->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  197. n5->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  198. n6->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  199. n7->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  200. n8->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  201. n9->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  202. n10->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  203. n11->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  204. n12->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  205. n13->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  206. n14->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  207. n15->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  208. n16->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  209. n17->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  210. n18->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  211. n19->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  212. n20->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  213.  
  214.  
  215. int unlocked=0;
  216. scene::IAnimatedMesh* br = smgr->getMesh("../../media/barrier.obj");
  217. b1 = smgr->addOctreeSceneNode(br->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  218. b1->setScale(core::vector3df(22, 0, 22));
  219. b1->setPosition(core::vector3df(x-40,-4,y));
  220. b1->setMaterialTexture(0, driver->getTexture("../../media/bar.jpg"));
  221.  
  222.  
  223. scene::IAnimatedMesh* fcube = smgr->getMesh("../../media/snakehead.obj");
  224. scene::IMeshSceneNode* nd = 0;
  225. nd = smgr->addOctreeSceneNode(fcube->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  226. nd->setScale(core::vector3df(12, 12, 12));
  227. //nd->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true);
  228. device->getCursorControl()->setVisible(false);
  229. //nd->setMaterialTexture(0, driver->getTexture((const io::path) maptexture.c_str()));
  230. nd->getMaterial(0).SpecularColor.set(0,0,0,0);
  231. scene::ITriangleSelector* selector = 0;
  232. if (nd)
  233. {
  234. nd->setPosition(core::vector3df(100,0,85));
  235. selector = smgr->createOctreeTriangleSelector(
  236. nd->getMesh(), nd, 128);
  237. nd->setMaterialType( video::EMT_SOLID );
  238. nd->setTriangleSelector(selector);
  239. nd->setRotation(core::vector3df(0,180,0));
  240. nd->setMaterialTexture(0, driver->getTexture("../../media/snake.jpg"));
  241. nd->setMaterialFlag(EMF_LIGHTING, true);
  242.  
  243. }
  244. scene::IAnimatedMesh* item = smgr->getMesh("../../media/coin.obj");
  245. scene::IMeshSceneNode* itemnode = 0;
  246. itemnode = smgr->addOctreeSceneNode(item->getMesh(0), 0, IDFlag_IsPickable, IDFlag_IsHighlightable);
  247. if (itemnode)
  248. {
  249. itemnode->setMaterialTexture(0, driver->getTexture("../../media/coin.jpg"));
  250. itemnode->setPosition(core::vector3df(ix,0,iy));
  251. itemnode->setScale(core::vector3df(4, 4, 4));
  252. }
  253. if (selector)
  254. {
  255. scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
  256. selector, itemnode, core::vector3df(30,50,30),
  257. core::vector3df(0,-10,0), core::vector3df(0,30,0));
  258. selector->drop();
  259. nd->addAnimator(anim);
  260. anim->drop();
  261. }
  262.  
  263.  
  264. scene::ICameraSceneNode* camera = smgr->addCameraSceneNode(0, vector3df(200,100,85), vector3df(100,0,85));
  265.  
  266. scene::ILightSceneNode * light = smgr->addLightSceneNode(0, core::vector3df(-70,100,300),
  267. video::SColorf(50.0f,50.0f,50.0f,50.0f), 100000.0f);
  268.  
  269. light->setID(ID_IsNotPickable);
  270. scene::ISceneNode* highlightedSceneNode = 0;
  271. scene::ISceneCollisionManager* collMan = smgr->getSceneCollisionManager();
  272. core::stringw message;
  273.  
  274. while(device->run())
  275. {
  276.  
  277. driver->beginScene(true, true, SColor(0,200,200,200));
  278. smgr->drawAll();
  279. driver->endScene();
  280.  
  281. if(GetAsyncKeyState(KEY_ESCAPE) != 0)
  282. {
  283.  
  284. if (mouse){
  285. device->getCursorControl()->setVisible(false);
  286. mouse = false;
  287. }else{
  288. mouse = true;
  289. device->getCursorControl()->setVisible(true);
  290. }
  291. }
  292. if(GetAsyncKeyState(VK_SPACE) != 0)
  293. {
  294. }
  295. if(GetAsyncKeyState(VK_SHIFT) != 0)
  296. {
  297. n1->remove();
  298. n2->remove();
  299. n3->remove();
  300. n4->remove();
  301. n5->remove();
  302. }
  303.  
  304. if(GetAsyncKeyState(KEY_UP) != 0)
  305. {
  306. if (dir!=2){dir = 1;nd->setRotation(core::vector3df(0,360,0));}
  307. }
  308. if(GetAsyncKeyState(KEY_DOWN) != 0)
  309. {
  310. if (dir!=1){dir = 2;nd->setRotation(core::vector3df(0,180,0));}
  311. }
  312. if(GetAsyncKeyState(KEY_LEFT) != 0)
  313. {
  314. if (dir!=3){dir = 4;nd->setRotation(core::vector3df(0,-90,0));}
  315. }
  316. if(GetAsyncKeyState(KEY_RIGHT) != 0)
  317. {
  318. if (dir!=4){dir = 3;nd->setRotation(core::vector3df(0,90,0));}
  319. }
  320. if(GetAsyncKeyState(KEY_KEY_T) != 0)
  321. {
  322. cout <<"T"<<endl;
  323. }
  324.  
  325.  
  326. //COLLISIONS
  327. if (x-11<=ix && x+11>=ix && y-11<=iy && y+11>=iy){
  328. collision=true;
  329. }
  330. if(collision){
  331. ix = rand()%100;
  332. iy = rand()%150;
  333. score++;
  334. unlocked++;
  335. itemnode->setPosition(core::vector3df(ix,0,iy));
  336. collision=false;
  337. }
  338.  
  339.  
  340. if (x-8<=x1 && x+8>=x1 && y-8<=y1 && y+8>=y1 && ct-1!=1 ){
  341. go=true;
  342. }
  343. if (x-8<=x2 && x+8>=x2 && y-8<=y2 && y+8>=y2 && ct-1!=2 ){
  344. go=true;
  345. }
  346. if (x-8<=x3 && x+8>=x3 && y-8<=y3 && y+8>=y3 && ct-1!=3 ){
  347. go=true;
  348. }
  349. if (x-8<=x4 && x+8>=x4 && y-8<=y4 && y+8>=y4 && ct-1!=4 ){
  350. go=true;
  351. }
  352. if (x-8<=x5 && x+8>=x5 && y-8<=y5 && y+8>=y5 && ct-1!=5 ){
  353. go=true;
  354. }
  355. if (x-8<=x6 && x+8>=x6 && y-8<=y6 && y+8>=y6 && ct-1!=6 ){
  356. go=true;
  357. }
  358. if (x-8<=x7 && x+8>=x7 && y-8<=y7 && y+8>=y7 && ct-1!=7 ){
  359. go=true;
  360. }
  361. if (x-8<=x8 && x+8>=x8 && y-8<=y8 && y+8>=y8 && ct-1!=8 ){
  362. go=true;
  363. }
  364. if (x-8<=x9 && x+8>=x9 && y-8<=y9 && y+8>=y9 && ct-1!=9 ){
  365. go=true;
  366. }
  367. if (x-8<=x10 && x+8>=x10 && y-8<=y10 && y+8>=y10 && ct-1!=10 ){
  368. go=true;
  369. }
  370. if (x-8<=x11 && x+8>=x11 && y-8<=y11 && y+8>=y11 && ct-1!=11 ){
  371. go=true;
  372. }
  373. if (x-8<=x12 && x+8>=x12 && y-8<=y12 && y+8>=y12 && ct-1!=12 ){
  374. go=true;
  375. }
  376. if (x-8<=x13 && x+8>=x13 && y-8<=y13 && y+8>=y13 && ct-1!=13 ){
  377. go=true;
  378. }
  379. if (x-8<=x14 && x+8>=x14 && y-8<=y14 && y+8>=y14 && ct-1!=14 ){
  380. go=true;
  381. }
  382. if (x-8<=x15 && x+8>=x15 && y-8<=y15 && y+8>=y15 && ct-1!=15 ){
  383. go=true;
  384. }
  385. if (x-8<=x16 && x+8>=x16 && y-8<=y16 && y+8>=y16 && ct-1!=16 ){
  386. go=true;
  387. }
  388. if (x-8<=x17 && x+8>=x17 && y-8<=y17 && y+8>=y17 && ct-1!=17 ){
  389. go=true;
  390. }
  391. if (x-8<=x18 && x+8>=x18 && y-8<=y18 && y+8>=y18 && ct-1!=18 ){
  392. go=true;
  393. }
  394. if (x-8<=x19 && x+8>=x19 && y-8<=y19 && y+8>=y19 && ct-1!=19 ){
  395. go=true;
  396. }
  397. if (x-8<=x20 && x+8>=x20 && y-8<=y20 && y+8>=y20 && ct-1!=20 ){
  398. go=true;
  399. }
  400. if (x>=150 || y>=150 || x<=0 || y<=0){ go=true;}
  401. //COLLISIONS
  402. if (go){
  403. cout <<"DEAD"<<endl;
  404. unlocked=0;
  405. score=0;
  406. loop=0;
  407.  
  408. ct=1;
  409. xx=100;
  410. yy=85;
  411. collision=false;
  412. ix = rand()%100;
  413. iy = rand()%150;
  414. x = 100;
  415. y = 85;
  416. x1 = 500;
  417. x2 = 500;
  418. x3 = 500;
  419. x4 = 500;
  420. x5 = 500;
  421. x6 = 500;
  422. x7 = 500;
  423. x8 = 500;
  424. x9 = 500;
  425. x10 = 500;
  426. x11 = 500;
  427. x12 = 500;
  428. x13 = 500;
  429. x14 = 500;
  430. x15 = 500;
  431. x16 = 500;
  432. x17 = 500;
  433. x18 = 500;
  434. x19 = 500;
  435. x20 = 500;
  436. y1 = 500;
  437. y2 = 500;
  438. y3 = 500;
  439. y4 = 500;
  440. y5 = 500;
  441. y6 = 500;
  442. y7 = 500;
  443. y8 = 500;
  444. y9 = 500;
  445. y10 = 500;
  446. y11 = 500;
  447. y12 = 500;
  448. y13 = 500;
  449. y14 = 500;
  450. y15 = 500;
  451. y16 = 500;
  452. y17 = 500;
  453. y18 = 500;
  454. y19 = 500;
  455. y20 = 500;
  456. go=false;
  457.  
  458. dir = 2;
  459. mouse=false;
  460.  
  461.  
  462.  
  463. n1->setPosition(core::vector3df(500,0,500));
  464. n2->setPosition(core::vector3df(500,0,500));
  465. n3->setPosition(core::vector3df(500,0,500));
  466. n4->setPosition(core::vector3df(500,0,500));
  467. n5->setPosition(core::vector3df(500,0,500));
  468. n6->setPosition(core::vector3df(500,0,500));
  469. n7->setPosition(core::vector3df(500,0,500));
  470. n8->setPosition(core::vector3df(500,0,500));
  471. n9->setPosition(core::vector3df(500,0,500));
  472. n10->setPosition(core::vector3df(500,0,500));
  473. n11->setPosition(core::vector3df(500,0,500));
  474. n12->setPosition(core::vector3df(500,0,500));
  475. n13->setPosition(core::vector3df(500,0,500));
  476. n14->setPosition(core::vector3df(500,0,500));
  477. n15->setPosition(core::vector3df(500,0,500));
  478. n16->setPosition(core::vector3df(500,0,500));
  479. n17->setPosition(core::vector3df(500,0,500));
  480. n18->setPosition(core::vector3df(500,0,500));
  481. n19->setPosition(core::vector3df(500,0,500));
  482. n20->setPosition(core::vector3df(500,0,500));
  483. itemnode->setPosition(core::vector3df(ix,0,iy));
  484. nd->setPosition(core::vector3df(x,0,y));
  485. nd->setRotation(core::vector3df(0,180,0));
  486. go=false;
  487. }
  488.  
  489.  
  490. Sleep(2);
  491. xx=x;
  492. yy=y;
  493. if (dir==1){x-=0.4; xx=x+10;}
  494. if (dir==2){x+=0.4; xx=x-10;}
  495. if (dir==3){y+=0.4;yy=y-10;}
  496. if (dir==4){y-=0.4;yy=y+10;}
  497. nd->setPosition(core::vector3df(x,0,y));
  498.  
  499. if (loop==40){
  500. if (unlocked!=0){
  501. if (ct==1 && unlocked>=1){
  502. n1->setPosition(core::vector3df(x,0,y));
  503. x1=xx;
  504. y1=yy;
  505. }
  506. if (ct==2 && unlocked>=2){
  507. n2->setPosition(core::vector3df(x,0,y));
  508. x2=xx;
  509. y2=yy;
  510. }
  511. if (ct==3 && unlocked>=3){
  512. n3->setPosition(core::vector3df(x,0,y));
  513. x3=xx;
  514. y3=yy;
  515. }
  516. if (ct==4 && unlocked>=4){
  517. n4->setPosition(core::vector3df(x,0,y));
  518. x4=xx;
  519. y4=yy;
  520. }
  521. if (ct==5 && unlocked>=5){
  522. n5->setPosition(core::vector3df(x,0,y));
  523. x5=xx;
  524. y5=yy;
  525. }
  526. if (ct==6 && unlocked>=6){
  527. n6->setPosition(core::vector3df(x,0,y));
  528. x6=xx;
  529. y6=yy;
  530. }
  531. if (ct==7 && unlocked>=7){
  532. n7->setPosition(core::vector3df(x,0,y));
  533. x7=xx;
  534. y7=yy;
  535. }
  536. if (ct==8 && unlocked>=8){
  537. n8->setPosition(core::vector3df(x,0,y));
  538. x8=xx;
  539. y8=yy;
  540. }
  541. if (ct==9 && unlocked>=9){
  542. n9->setPosition(core::vector3df(x,0,y));
  543. x9=xx;
  544. y9=yy;
  545. }
  546. if (ct==10 && unlocked>=10){
  547. n10->setPosition(core::vector3df(x,0,y));
  548. x10=xx;
  549. y10=yy;
  550. }
  551. if (ct==11 && unlocked>=11){
  552. n11->setPosition(core::vector3df(x,0,y));
  553. x11=xx;
  554. y11=yy;
  555. }
  556. if (ct==12 && unlocked>=12){
  557. n12->setPosition(core::vector3df(x,0,y));
  558. x12=xx;
  559. y12=yy;
  560. }
  561. if (ct==13 && unlocked>=13){
  562. n13->setPosition(core::vector3df(x,0,y));
  563. x13=xx;
  564. y13=yy;
  565. }
  566. if (ct==14 && unlocked>=14){
  567. n14->setPosition(core::vector3df(x,0,y));
  568. x14=xx;
  569. y14=yy;
  570. }
  571. if (ct==15 && unlocked>=15){
  572. n15->setPosition(core::vector3df(x,0,y));
  573. x15=xx;
  574. y15=yy;
  575. }
  576. if (ct==16 && unlocked>=16){
  577. n16->setPosition(core::vector3df(x,0,y));
  578. x16=xx;
  579. y16=yy;
  580. }
  581. if (ct==17 && unlocked>=17){
  582. n17->setPosition(core::vector3df(x,0,y));
  583. x17=xx;
  584. y17=yy;
  585. }
  586. if (ct==18 && unlocked>=18){
  587. n18->setPosition(core::vector3df(x,0,y));
  588. x18=xx;
  589. y18=yy;
  590. }
  591. if (ct==19 && unlocked>=19){
  592. n19->setPosition(core::vector3df(x,0,y));
  593. x19=xx;
  594. y19=yy;
  595. }
  596. if (ct==20 && unlocked>=20){
  597. n20->setPosition(core::vector3df(x,0,y));
  598. x20=xx;
  599. y20=yy;
  600. }
  601. if (ct==unlocked){ct=0;}else if(ct==20){ct=0;}
  602.  
  603. ct++;
  604.  
  605. }
  606. loop=0;
  607. }
  608.  
  609. //core::stringw str = L"";
  610. // str += title;
  611. // str += " [ Score: ";
  612. //str += score;
  613. //str += " ]";
  614. core::stringw str = L"";
  615. str += title;
  616. str += " Score: ";
  617. str += score;
  618. str += " TAIL SECTOR: ";
  619. str += ct;
  620. str += " X: ";
  621. str += nd->getPosition().X;
  622. str += " Y: ";
  623. str += nd->getPosition().Y;
  624. str += " Z: ";
  625. str += nd->getPosition().Z;
  626. str += "]";
  627. device->setWindowCaption(str.c_str());
  628. loop++;
  629. }
  630. device->drop();
  631. return 0;
  632. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement