Guest User

Untitled

a guest
Oct 7th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. function renderVisionCone() //draws the walls
  2. {
  3. clearScreen();
  4. DynamicSprite.Create(620, 400);
  5. DrawingSurface *dungeonWalls = Room.GetDrawingSurfaceForBackground();
  6.  
  7.  
  8. if (playerChar.faceDir==eFaceUp){
  9. MazeType tile[10];
  10. tile[0]=GetCell(playerChar.x-2, playerChar.y-2);
  11. tile[1]=GetCell(playerChar.x-1, playerChar.y-2);
  12. tile[2]=GetCell(playerChar.x, playerChar.y-2);
  13. tile[3]=GetCell(playerChar.x+1, playerChar.y-2);
  14. tile[4]=GetCell(playerChar.x+2, playerChar.y-2);
  15. tile[5]=GetCell(playerChar.x-1, playerChar.y-1);
  16. tile[6]=GetCell(playerChar.x, playerChar.y-1);
  17. tile[7]=GetCell(playerChar.x+1, playerChar.y-1);
  18. tile[8]=GetCell(playerChar.x-1, playerChar.y);
  19. tile[9]=GetCell(playerChar.x+1, playerChar.y);
  20.  
  21. if (tile[0]==eMazeWall){
  22. dungeonWalls.DrawImage(0, 0, 14);
  23. }
  24.  
  25. if (tile[1]==eMazeWall){
  26. dungeonWalls.DrawImage(0, 0, 10);
  27. }
  28.  
  29. if (tile[3]==eMazeWall){
  30. dungeonWalls.DrawImage(0, 0, 9);
  31. }
  32.  
  33. if (tile[2]==eMazeWall){
  34. dungeonWalls.DrawImage(0, 0, 3);
  35. }
  36.  
  37. if (tile[4]==eMazeWall){
  38. dungeonWalls.DrawImage(0, 0, 13);
  39. }
  40.  
  41. if (tile[5]==eMazeWall){
  42. dungeonWalls.DrawImage(0, 0, 8);
  43. }
  44.  
  45. if (tile[7]==eMazeWall){
  46. dungeonWalls.DrawImage(0, 0, 7);
  47. }
  48.  
  49. if (tile[6]==eMazeWall){
  50. dungeonWalls.DrawImage(0, 0, 2);
  51. }
  52.  
  53. if (tile[8]==eMazeWall){
  54. dungeonWalls.DrawImage(0, 0, 6);
  55. }
  56.  
  57. if (tile[9]==eMazeWall){
  58. dungeonWalls.DrawImage(0, 0, 5);
  59. }
  60.  
  61.  
  62. }
  63.  
  64. if (playerChar.faceDir==eFaceRight){
  65. MazeType tile1[10];
  66. tile1[0]=GetCell(playerChar.x+2, playerChar.y-2);
  67. tile1[1]=GetCell(playerChar.x+2, playerChar.y-1);
  68. tile1[2]=GetCell(playerChar.x+2, playerChar.y);
  69. tile1[3]=GetCell(playerChar.x+2, playerChar.y+1);
  70. tile1[4]=GetCell(playerChar.x+2, playerChar.y+2);
  71. tile1[5]=GetCell(playerChar.x+1, playerChar.y-1);
  72. tile1[6]=GetCell(playerChar.x+1, playerChar.y);
  73. tile1[7]=GetCell(playerChar.x+1, playerChar.y+1);
  74. tile1[8]=GetCell(playerChar.x, playerChar.y-1);
  75. tile1[9]=GetCell(playerChar.x, playerChar.y+1);
  76.  
  77.  
  78.  
  79. if (tile1[0]==eMazeWall){
  80. dungeonWalls.DrawImage(0, 0, 14);
  81. }
  82.  
  83. if (tile1[1]==eMazeWall){
  84. dungeonWalls.DrawImage(0, 0, 10);
  85. }
  86.  
  87. if (tile1[3]==eMazeWall){
  88. dungeonWalls.DrawImage(0, 0, 9);
  89. }
  90.  
  91.  
  92. if (tile1[2]==eMazeWall){
  93. dungeonWalls.DrawImage(0, 0, 3);
  94. }
  95.  
  96. if (tile1[4]==eMazeWall){
  97. dungeonWalls.DrawImage(0, 0, 13);
  98. }
  99.  
  100. if (tile1[5]==eMazeWall){
  101. dungeonWalls.DrawImage(0, 0, 8);
  102. }
  103.  
  104. if (tile1[7]==eMazeWall){
  105. dungeonWalls.DrawImage(0, 0, 7);
  106. }
  107.  
  108. if (tile1[6]==eMazeWall){
  109. dungeonWalls.DrawImage(0, 0, 2);
  110. }
  111.  
  112. if (tile1[8]==eMazeWall){
  113. dungeonWalls.DrawImage(0, 0, 6);
  114. }
  115.  
  116. if (tile1[9]==eMazeWall){
  117. dungeonWalls.DrawImage(0, 0, 5);
  118. }
  119. }
  120.  
  121. if (playerChar.faceDir==eFaceDown){
  122. MazeType tile2[10];
  123. tile2[0]=GetCell(playerChar.x+2, playerChar.y+2);
  124. tile2[1]=GetCell(playerChar.x+1, playerChar.y+2);
  125. tile2[2]=GetCell(playerChar.x, playerChar.y+2);
  126. tile2[3]=GetCell(playerChar.x-1, playerChar.y+2);
  127. tile2[4]=GetCell(playerChar.x-2, playerChar.y+2);
  128. tile2[5]=GetCell(playerChar.x+1, playerChar.y+1);
  129. tile2[6]=GetCell(playerChar.x, playerChar.y+1);
  130. tile2[7]=GetCell(playerChar.x-1, playerChar.y+1);
  131. tile2[8]=GetCell(playerChar.x+1, playerChar.y);
  132. tile2[9]=GetCell(playerChar.x-1, playerChar.y);
  133.  
  134.  
  135.  
  136. if (tile2[0]==eMazeWall){
  137. dungeonWalls.DrawImage(0, 0, 14);
  138. }
  139.  
  140. if (tile2[1]==eMazeWall){
  141. dungeonWalls.DrawImage(0, 0, 10);
  142. }
  143.  
  144. if (tile2[3]==eMazeWall){
  145. dungeonWalls.DrawImage(0, 0, 9);
  146. }
  147.  
  148.  
  149. if (tile2[2]==eMazeWall){
  150. dungeonWalls.DrawImage(0, 0, 3);
  151. }
  152.  
  153. if (tile2[4]==eMazeWall){
  154. dungeonWalls.DrawImage(0, 0, 13);
  155. }
  156.  
  157. if (tile2[5]==eMazeWall){
  158. dungeonWalls.DrawImage(0, 0, 8);
  159. }
  160.  
  161. if (tile2[7]==eMazeWall){
  162. dungeonWalls.DrawImage(0, 0, 7);
  163. }
  164.  
  165. if (tile2[6]==eMazeWall){
  166. dungeonWalls.DrawImage(0, 0, 2);
  167. }
  168.  
  169. if (tile2[8]==eMazeWall){
  170. dungeonWalls.DrawImage(0, 0, 6);
  171. }
  172.  
  173. if (tile2[9]==eMazeWall){
  174. dungeonWalls.DrawImage(0, 0, 5);
  175. }
  176. }
  177. if (playerChar.faceDir==eFaceLeft){
  178. MazeType tile3[10];
  179. tile3[0]=GetCell(playerChar.x-2, playerChar.y+2);
  180. tile3[1]=GetCell(playerChar.x-2, playerChar.y+1);
  181. tile3[2]=GetCell(playerChar.x-2, playerChar.y);
  182. tile3[3]=GetCell(playerChar.x-2, playerChar.y-1);
  183. tile3[4]=GetCell(playerChar.x-2, playerChar.y-2);
  184. tile3[5]=GetCell(playerChar.x-1, playerChar.y+1);
  185. tile3[6]=GetCell(playerChar.x-1, playerChar.y);
  186. tile3[7]=GetCell(playerChar.x-1, playerChar.y-1);
  187. tile3[8]=GetCell(playerChar.x, playerChar.y+1);
  188. tile3[9]=GetCell(playerChar.x, playerChar.y-1);
  189.  
  190.  
  191.  
  192. if (tile3[0]==eMazeWall){
  193. dungeonWalls.DrawImage(0, 0, 14);
  194. }
  195.  
  196. if (tile3[1]==eMazeWall){
  197. dungeonWalls.DrawImage(0, 0, 10);
  198. }
  199.  
  200. if (tile3[3]==eMazeWall){
  201. dungeonWalls.DrawImage(0, 0, 9);
  202. }
  203.  
  204. if (tile3[2]==eMazeWall){
  205. dungeonWalls.DrawImage(0, 0, 3);
  206. }
  207.  
  208. if (tile3[4]==eMazeWall){
  209. dungeonWalls.DrawImage(0, 0, 13);
  210. }
  211.  
  212. if (tile3[5]==eMazeWall){
  213. dungeonWalls.DrawImage(0, 0, 8);
  214. }
  215.  
  216. if (tile3[7]==eMazeWall){
  217. dungeonWalls.DrawImage(0, 0, 7);
  218. }
  219.  
  220. if (tile3[6]==eMazeWall){
  221. dungeonWalls.DrawImage(0, 0, 2);
  222. }
  223.  
  224. if (tile3[8]==eMazeWall){
  225. dungeonWalls.DrawImage(0, 0, 6);
  226. }
  227.  
  228. if (tile3[9]==eMazeWall){
  229. dungeonWalls.DrawImage(0, 0, 5);
  230. }
  231. }
  232. }
Advertisement
Add Comment
Please, Sign In to add comment