studyup 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (898) hide show
  1. package/hexgl-package/HexGL-master/.htaccess +4 -0
  2. package/hexgl-package/HexGL-master/LICENSE +21 -0
  3. package/hexgl-package/HexGL-master/README.md +26 -0
  4. package/hexgl-package/HexGL-master/audio/LICENSE +28 -0
  5. package/hexgl-package/HexGL-master/audio/bg.ogg +0 -0
  6. package/hexgl-package/HexGL-master/audio/boost.ogg +0 -0
  7. package/hexgl-package/HexGL-master/audio/crash.ogg +0 -0
  8. package/hexgl-package/HexGL-master/audio/destroyed.ogg +0 -0
  9. package/hexgl-package/HexGL-master/audio/wind.ogg +0 -0
  10. package/hexgl-package/HexGL-master/bkcore/Audio.js +142 -0
  11. package/hexgl-package/HexGL-master/bkcore/hexgl/CameraChase.js +73 -0
  12. package/hexgl-package/HexGL-master/bkcore/hexgl/Gameplay.js +231 -0
  13. package/hexgl-package/HexGL-master/bkcore/hexgl/HUD.js +270 -0
  14. package/hexgl-package/HexGL-master/bkcore/hexgl/HexGL.js +446 -0
  15. package/hexgl-package/HexGL-master/bkcore/hexgl/Ladder.js +52 -0
  16. package/hexgl-package/HexGL-master/bkcore/hexgl/RaceData.js +99 -0
  17. package/hexgl-package/HexGL-master/bkcore/hexgl/ShipControls.js +806 -0
  18. package/hexgl-package/HexGL-master/bkcore/hexgl/ShipEffects.js +186 -0
  19. package/hexgl-package/HexGL-master/bkcore/hexgl/tracks/Cityscape.js +521 -0
  20. package/hexgl-package/HexGL-master/bkcore/threejs/Loader.js +260 -0
  21. package/hexgl-package/HexGL-master/bkcore/threejs/Particles.js +191 -0
  22. package/hexgl-package/HexGL-master/bkcore/threejs/Preloader.js +151 -0
  23. package/hexgl-package/HexGL-master/bkcore/threejs/RenderManager.js +132 -0
  24. package/hexgl-package/HexGL-master/bkcore/threejs/Shaders.js +950 -0
  25. package/hexgl-package/HexGL-master/bkcore.coffee/ImageData.coffee +141 -0
  26. package/hexgl-package/HexGL-master/bkcore.coffee/ImageData.js +156 -0
  27. package/hexgl-package/HexGL-master/bkcore.coffee/Timer.coffee +118 -0
  28. package/hexgl-package/HexGL-master/bkcore.coffee/Timer.js +159 -0
  29. package/hexgl-package/HexGL-master/bkcore.coffee/Utils.coffee +193 -0
  30. package/hexgl-package/HexGL-master/bkcore.coffee/Utils.js +250 -0
  31. package/hexgl-package/HexGL-master/bkcore.coffee/controllers/GamepadController.coffee +45 -0
  32. package/hexgl-package/HexGL-master/bkcore.coffee/controllers/GamepadController.js +73 -0
  33. package/hexgl-package/HexGL-master/bkcore.coffee/controllers/OrientationController.coffee +72 -0
  34. package/hexgl-package/HexGL-master/bkcore.coffee/controllers/OrientationController.js +130 -0
  35. package/hexgl-package/HexGL-master/bkcore.coffee/controllers/TouchController.coffee +109 -0
  36. package/hexgl-package/HexGL-master/bkcore.coffee/controllers/TouchController.js +188 -0
  37. package/hexgl-package/HexGL-master/bkcore.coffee/tests.html +10 -0
  38. package/hexgl-package/HexGL-master/bkcore.coffee/threejs/Particles.coffee +199 -0
  39. package/hexgl-package/HexGL-master/bkcore.coffee/threejs/Particles.js +210 -0
  40. package/hexgl-package/HexGL-master/cache.appcache +74 -0
  41. package/hexgl-package/HexGL-master/css/BebasNeue-webfont.eot +0 -0
  42. package/hexgl-package/HexGL-master/css/BebasNeue-webfont.svg +245 -0
  43. package/hexgl-package/HexGL-master/css/BebasNeue-webfont.ttf +0 -0
  44. package/hexgl-package/HexGL-master/css/BebasNeue-webfont.woff +0 -0
  45. package/hexgl-package/HexGL-master/css/bg.jpg +0 -0
  46. package/hexgl-package/HexGL-master/css/fonts.css +16 -0
  47. package/hexgl-package/HexGL-master/css/help-0.png +0 -0
  48. package/hexgl-package/HexGL-master/css/help-1.png +0 -0
  49. package/hexgl-package/HexGL-master/css/help-2.png +0 -0
  50. package/hexgl-package/HexGL-master/css/help-3.png +0 -0
  51. package/hexgl-package/HexGL-master/css/mobile-controls-1.jpg +0 -0
  52. package/hexgl-package/HexGL-master/css/mobile-controls-2.jpg +0 -0
  53. package/hexgl-package/HexGL-master/css/mobile-over.jpg +0 -0
  54. package/hexgl-package/HexGL-master/css/mobile.jpg +0 -0
  55. package/hexgl-package/HexGL-master/css/multi.css +264 -0
  56. package/hexgl-package/HexGL-master/css/title.png +0 -0
  57. package/hexgl-package/HexGL-master/css/touchcontroller.css +8 -0
  58. package/hexgl-package/HexGL-master/favicon.png +0 -0
  59. package/hexgl-package/HexGL-master/geometries/bonus/base/base.js +45 -0
  60. package/hexgl-package/HexGL-master/geometries/booster/booster.js +45 -0
  61. package/hexgl-package/HexGL-master/geometries/ships/feisar/feisar.js +45 -0
  62. package/hexgl-package/HexGL-master/geometries/tracks/cityscape/bonus/speed.js +45 -0
  63. package/hexgl-package/HexGL-master/geometries/tracks/cityscape/scrapers1.js +45 -0
  64. package/hexgl-package/HexGL-master/geometries/tracks/cityscape/scrapers2.js +45 -0
  65. package/hexgl-package/HexGL-master/geometries/tracks/cityscape/start.js +45 -0
  66. package/hexgl-package/HexGL-master/geometries/tracks/cityscape/startbanner.js +45 -0
  67. package/hexgl-package/HexGL-master/geometries/tracks/cityscape/track.js +45 -0
  68. package/hexgl-package/HexGL-master/geometries/tracks/edge/track.js +38 -0
  69. package/hexgl-package/HexGL-master/icon_128.png +0 -0
  70. package/hexgl-package/HexGL-master/icon_256.png +0 -0
  71. package/hexgl-package/HexGL-master/icon_32.png +0 -0
  72. package/hexgl-package/HexGL-master/icon_64.png +0 -0
  73. package/hexgl-package/HexGL-master/index.html +129 -0
  74. package/hexgl-package/HexGL-master/launch.coffee +85 -0
  75. package/hexgl-package/HexGL-master/launch.js +116 -0
  76. package/hexgl-package/HexGL-master/libs/DAT.GUI.min.js +53 -0
  77. package/hexgl-package/HexGL-master/libs/Detector.js +59 -0
  78. package/hexgl-package/HexGL-master/libs/Editor.html +717 -0
  79. package/hexgl-package/HexGL-master/libs/Editor_files/App.js +212 -0
  80. package/hexgl-package/HexGL-master/libs/Editor_files/CanvasRenderer.js +389 -0
  81. package/hexgl-package/HexGL-master/libs/Editor_files/Diagram.js +148 -0
  82. package/hexgl-package/HexGL-master/libs/Editor_files/Iterator.js +92 -0
  83. package/hexgl-package/HexGL-master/libs/Editor_files/Links.js +56 -0
  84. package/hexgl-package/HexGL-master/libs/Editor_files/ModuleList.js +47 -0
  85. package/hexgl-package/HexGL-master/libs/Editor_files/Node.js +122 -0
  86. package/hexgl-package/HexGL-master/libs/Editor_files/Parser.js +140 -0
  87. package/hexgl-package/HexGL-master/libs/Editor_files/Project.js +162 -0
  88. package/hexgl-package/HexGL-master/libs/Editor_files/Timer.js +166 -0
  89. package/hexgl-package/HexGL-master/libs/Editor_files/ace.js +11 -0
  90. package/hexgl-package/HexGL-master/libs/Editor_files/class.js +989 -0
  91. package/hexgl-package/HexGL-master/libs/Editor_files/editor.css +16 -0
  92. package/hexgl-package/HexGL-master/libs/Editor_files/font.css +24 -0
  93. package/hexgl-package/HexGL-master/libs/Editor_files/gamecore.js +133 -0
  94. package/hexgl-package/HexGL-master/libs/Editor_files/hashlist.js +41 -0
  95. package/hexgl-package/HexGL-master/libs/Editor_files/jhashtable.js +468 -0
  96. package/hexgl-package/HexGL-master/libs/Editor_files/jquery-1.8.js +2 -0
  97. package/hexgl-package/HexGL-master/libs/Editor_files/kinetic.js +30 -0
  98. package/hexgl-package/HexGL-master/libs/Editor_files/main.css +204 -0
  99. package/hexgl-package/HexGL-master/libs/Editor_files/mode-json.js +1 -0
  100. package/hexgl-package/HexGL-master/libs/Editor_files/pooled.js +542 -0
  101. package/hexgl-package/HexGL-master/libs/Editor_files/theme-monokai.js +1 -0
  102. package/hexgl-package/HexGL-master/libs/ShaderExtras.js +1788 -0
  103. package/hexgl-package/HexGL-master/libs/Stats.js +6 -0
  104. package/hexgl-package/HexGL-master/libs/Three.dev.js +758 -0
  105. package/hexgl-package/HexGL-master/libs/Three.r53.js +767 -0
  106. package/hexgl-package/HexGL-master/libs/leap-0.4.1.min.js +3 -0
  107. package/hexgl-package/HexGL-master/libs/postprocessing/BloomPass.js +100 -0
  108. package/hexgl-package/HexGL-master/libs/postprocessing/DotScreenPass.js +52 -0
  109. package/hexgl-package/HexGL-master/libs/postprocessing/EffectComposer.js +143 -0
  110. package/hexgl-package/HexGL-master/libs/postprocessing/FilmPass.js +51 -0
  111. package/hexgl-package/HexGL-master/libs/postprocessing/MaskPass.js +86 -0
  112. package/hexgl-package/HexGL-master/libs/postprocessing/RenderPass.js +63 -0
  113. package/hexgl-package/HexGL-master/libs/postprocessing/SavePass.js +52 -0
  114. package/hexgl-package/HexGL-master/libs/postprocessing/ShaderPass.js +51 -0
  115. package/hexgl-package/HexGL-master/libs/postprocessing/TexturePass.js +37 -0
  116. package/hexgl-package/HexGL-master/manifest.webapp +18 -0
  117. package/hexgl-package/HexGL-master/package.webapp +10 -0
  118. package/hexgl-package/HexGL-master/package.zip +0 -0
  119. package/hexgl-package/HexGL-master/replays/cityscape-casual/bkcore.replay.json +1 -0
  120. package/hexgl-package/HexGL-master/textures/bonus/base/diffuse.jpg +0 -0
  121. package/hexgl-package/HexGL-master/textures/bonus/base/normal.jpg +0 -0
  122. package/hexgl-package/HexGL-master/textures/bonus/base/specular.jpg +0 -0
  123. package/hexgl-package/HexGL-master/textures/checker.png +0 -0
  124. package/hexgl-package/HexGL-master/textures/hud/hex.jpg +0 -0
  125. package/hexgl-package/HexGL-master/textures/hud/hud-bg.png +0 -0
  126. package/hexgl-package/HexGL-master/textures/hud/hud-fg-shield.png +0 -0
  127. package/hexgl-package/HexGL-master/textures/hud/hud-fg-speed.png +0 -0
  128. package/hexgl-package/HexGL-master/textures/particles/cloud - Copie.png +0 -0
  129. package/hexgl-package/HexGL-master/textures/particles/cloud.png +0 -0
  130. package/hexgl-package/HexGL-master/textures/particles/damage.png +0 -0
  131. package/hexgl-package/HexGL-master/textures/particles/spark - Copie.png +0 -0
  132. package/hexgl-package/HexGL-master/textures/particles/spark.png +0 -0
  133. package/hexgl-package/HexGL-master/textures/ships/feisar/booster/booster.png +0 -0
  134. package/hexgl-package/HexGL-master/textures/ships/feisar/booster/boostersprite.jpg +0 -0
  135. package/hexgl-package/HexGL-master/textures/ships/feisar/diffuse.jpg +0 -0
  136. package/hexgl-package/HexGL-master/textures/ships/feisar/normal.jpg +0 -0
  137. package/hexgl-package/HexGL-master/textures/ships/feisar/specular.jpg +0 -0
  138. package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/nx.jpg +0 -0
  139. package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/ny.jpg +0 -0
  140. package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/nz.jpg +0 -0
  141. package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/px.jpg +0 -0
  142. package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/py.jpg +0 -0
  143. package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/pz.jpg +0 -0
  144. package/hexgl-package/HexGL-master/textures/tracks/cityscape/collision.png +0 -0
  145. package/hexgl-package/HexGL-master/textures/tracks/cityscape/diffuse.jpg +0 -0
  146. package/hexgl-package/HexGL-master/textures/tracks/cityscape/height.png +0 -0
  147. package/hexgl-package/HexGL-master/textures/tracks/cityscape/normal.jpg +0 -0
  148. package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers1/diffuse.jpg +0 -0
  149. package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers1/normal.jpg +0 -0
  150. package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers1/specular.jpg +0 -0
  151. package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers2/diffuse.jpg +0 -0
  152. package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers2/normal.jpg +0 -0
  153. package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers2/specular.jpg +0 -0
  154. package/hexgl-package/HexGL-master/textures/tracks/cityscape/specular.jpg +0 -0
  155. package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/diffuse.jpg +0 -0
  156. package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/normal.jpg +0 -0
  157. package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/specular.jpg +0 -0
  158. package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/start.jpg +0 -0
  159. package/hexgl-package/HexGL-master/textures.full/bonus/base/diffuse.jpg +0 -0
  160. package/hexgl-package/HexGL-master/textures.full/bonus/base/normal.jpg +0 -0
  161. package/hexgl-package/HexGL-master/textures.full/bonus/base/specular.jpg +0 -0
  162. package/hexgl-package/HexGL-master/textures.full/checker.png +0 -0
  163. package/hexgl-package/HexGL-master/textures.full/hud/hex.jpg +0 -0
  164. package/hexgl-package/HexGL-master/textures.full/hud/hud-bg.png +0 -0
  165. package/hexgl-package/HexGL-master/textures.full/hud/hud-fg-shield.png +0 -0
  166. package/hexgl-package/HexGL-master/textures.full/hud/hud-fg-speed.png +0 -0
  167. package/hexgl-package/HexGL-master/textures.full/particles/cloud - Copie.png +0 -0
  168. package/hexgl-package/HexGL-master/textures.full/particles/cloud.png +0 -0
  169. package/hexgl-package/HexGL-master/textures.full/particles/damage.png +0 -0
  170. package/hexgl-package/HexGL-master/textures.full/particles/spark - Copie.png +0 -0
  171. package/hexgl-package/HexGL-master/textures.full/particles/spark.png +0 -0
  172. package/hexgl-package/HexGL-master/textures.full/ships/feisar/booster/booster.png +0 -0
  173. package/hexgl-package/HexGL-master/textures.full/ships/feisar/booster/boostersprite.jpg +0 -0
  174. package/hexgl-package/HexGL-master/textures.full/ships/feisar/diffuse.jpg +0 -0
  175. package/hexgl-package/HexGL-master/textures.full/ships/feisar/normal.jpg +0 -0
  176. package/hexgl-package/HexGL-master/textures.full/ships/feisar/specular.jpg +0 -0
  177. package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/nx.jpg +0 -0
  178. package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/ny.jpg +0 -0
  179. package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/nz.jpg +0 -0
  180. package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/px.jpg +0 -0
  181. package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/py.jpg +0 -0
  182. package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/pz.jpg +0 -0
  183. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/collision.png +0 -0
  184. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/diffuse.jpg +0 -0
  185. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/height.png +0 -0
  186. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/normal.jpg +0 -0
  187. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers1/diffuse.jpg +0 -0
  188. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers1/normal.jpg +0 -0
  189. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers1/specular.jpg +0 -0
  190. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers2/diffuse.jpg +0 -0
  191. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers2/normal.jpg +0 -0
  192. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers2/specular.jpg +0 -0
  193. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/specular.jpg +0 -0
  194. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/diffuse.jpg +0 -0
  195. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/normal.jpg +0 -0
  196. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/specular.jpg +0 -0
  197. package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/start.jpg +0 -0
  198. package/index.html +291 -0
  199. package/package.json +12 -3
  200. package/sandboxels-package/sandboxels-1.13.2/.github/CONTRIBUTING.md +10 -0
  201. package/sandboxels-package/sandboxels-1.13.2/.github/FUNDING.yml +13 -0
  202. package/sandboxels-package/sandboxels-1.13.2/.github/SUPPORT.md +9 -0
  203. package/sandboxels-package/sandboxels-1.13.2/404.html +74 -0
  204. package/sandboxels-package/sandboxels-1.13.2/CITATION.cff +42 -0
  205. package/sandboxels-package/sandboxels-1.13.2/CNAME +1 -0
  206. package/sandboxels-package/sandboxels-1.13.2/README.md +47 -0
  207. package/sandboxels-package/sandboxels-1.13.2/SECURITY.md +9 -0
  208. package/sandboxels-package/sandboxels-1.13.2/ad.html +73 -0
  209. package/sandboxels-package/sandboxels-1.13.2/aff.json +3 -0
  210. package/sandboxels-package/sandboxels-1.13.2/archive/first-version.html +234 -0
  211. package/sandboxels-package/sandboxels-1.13.2/archive/second-version.html +1293 -0
  212. package/sandboxels-package/sandboxels-1.13.2/archive/third-version.html +2242 -0
  213. package/sandboxels-package/sandboxels-1.13.2/archive.txt +231 -0
  214. package/sandboxels-package/sandboxels-1.13.2/backgrounds/License.txt +1 -0
  215. package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky.png +0 -0
  216. package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_dark.png +0 -0
  217. package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_grass.png +0 -0
  218. package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_pink.png +0 -0
  219. package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_purple.png +0 -0
  220. package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_warm.png +0 -0
  221. package/sandboxels-package/sandboxels-1.13.2/changelog.html +3362 -0
  222. package/sandboxels-package/sandboxels-1.13.2/changelog.txt +3096 -0
  223. package/sandboxels-package/sandboxels-1.13.2/controls.html +191 -0
  224. package/sandboxels-package/sandboxels-1.13.2/controls.txt +65 -0
  225. package/sandboxels-package/sandboxels-1.13.2/education-use.html +109 -0
  226. package/sandboxels-package/sandboxels-1.13.2/feed.rss +30 -0
  227. package/sandboxels-package/sandboxels-1.13.2/feedback.html +89 -0
  228. package/sandboxels-package/sandboxels-1.13.2/fonts/PressStart2P-License-OFL.txt +93 -0
  229. package/sandboxels-package/sandboxels-1.13.2/fonts/PressStart2P-Regular.ttf +0 -0
  230. package/sandboxels-package/sandboxels-1.13.2/fonts/VT323-License-OFL.txt +93 -0
  231. package/sandboxels-package/sandboxels-1.13.2/fonts/VT323-Regular.ttf +0 -0
  232. package/sandboxels-package/sandboxels-1.13.2/fonts/Vietnamese_Pixel.ttf +0 -0
  233. package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-ja.ttf +0 -0
  234. package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-ko.ttf +0 -0
  235. package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-latin.ttf +0 -0
  236. package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-zh_hans.ttf +0 -0
  237. package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-zh_hant.ttf +0 -0
  238. package/sandboxels-package/sandboxels-1.13.2/help.html +122 -0
  239. package/sandboxels-package/sandboxels-1.13.2/icons/80x15.png +0 -0
  240. package/sandboxels-package/sandboxels-1.13.2/icons/88x31.png +0 -0
  241. package/sandboxels-package/sandboxels-1.13.2/icons/android-chrome-192x192.png +0 -0
  242. package/sandboxels-package/sandboxels-1.13.2/icons/android-chrome-384x384.png +0 -0
  243. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-114x114-precomposed.png +0 -0
  244. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-114x114.png +0 -0
  245. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-120x120-precomposed.png +0 -0
  246. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-120x120.png +0 -0
  247. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-144x144-precomposed.png +0 -0
  248. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-144x144.png +0 -0
  249. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-152x152-precomposed.png +0 -0
  250. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-152x152.png +0 -0
  251. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-180x180-precomposed.png +0 -0
  252. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-180x180.png +0 -0
  253. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-57x57-precomposed.png +0 -0
  254. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-57x57.png +0 -0
  255. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-60x60-precomposed.png +0 -0
  256. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-60x60.png +0 -0
  257. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-72x72-precomposed.png +0 -0
  258. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-72x72.png +0 -0
  259. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-76x76-precomposed.png +0 -0
  260. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-76x76.png +0 -0
  261. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-precomposed.png +0 -0
  262. package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon.png +0 -0
  263. package/sandboxels-package/sandboxels-1.13.2/icons/browserconfig.xml +9 -0
  264. package/sandboxels-package/sandboxels-1.13.2/icons/card.png +0 -0
  265. package/sandboxels-package/sandboxels-1.13.2/icons/cover-3840x1240px-text.png +0 -0
  266. package/sandboxels-package/sandboxels-1.13.2/icons/cover-3840x1240px.png +0 -0
  267. package/sandboxels-package/sandboxels-1.13.2/icons/cover-3840x1240px.webp +0 -0
  268. package/sandboxels-package/sandboxels-1.13.2/icons/cover.png +0 -0
  269. package/sandboxels-package/sandboxels-1.13.2/icons/favicon-16x16.png +0 -0
  270. package/sandboxels-package/sandboxels-1.13.2/icons/favicon-32x32.png +0 -0
  271. package/sandboxels-package/sandboxels-1.13.2/icons/favicon.ico +0 -0
  272. package/sandboxels-package/sandboxels-1.13.2/icons/icon-hd.png +0 -0
  273. package/sandboxels-package/sandboxels-1.13.2/icons/icon.png +0 -0
  274. package/sandboxels-package/sandboxels-1.13.2/icons/index.html +196 -0
  275. package/sandboxels-package/sandboxels-1.13.2/icons/modulator.png +0 -0
  276. package/sandboxels-package/sandboxels-1.13.2/icons/mstile-150x150.png +0 -0
  277. package/sandboxels-package/sandboxels-1.13.2/icons/original-logo-recreated-pixel.png +0 -0
  278. package/sandboxels-package/sandboxels-1.13.2/icons/promo1.png +0 -0
  279. package/sandboxels-package/sandboxels-1.13.2/icons/promo2.png +0 -0
  280. package/sandboxels-package/sandboxels-1.13.2/icons/promo3.png +0 -0
  281. package/sandboxels-package/sandboxels-1.13.2/icons/promo4.png +0 -0
  282. package/sandboxels-package/sandboxels-1.13.2/icons/safari-pinned-tab.svg +107 -0
  283. package/sandboxels-package/sandboxels-1.13.2/icons/site.webmanifest +20 -0
  284. package/sandboxels-package/sandboxels-1.13.2/icons/tall.webp +0 -0
  285. package/sandboxels-package/sandboxels-1.13.2/icons/wallpaper-old.png +0 -0
  286. package/sandboxels-package/sandboxels-1.13.2/icons/wallpaper.png +0 -0
  287. package/sandboxels-package/sandboxels-1.13.2/icons/wallpaper.webp +0 -0
  288. package/sandboxels-package/sandboxels-1.13.2/icons/wordmark-black.png +0 -0
  289. package/sandboxels-package/sandboxels-1.13.2/icons/wordmark-white.png +0 -0
  290. package/sandboxels-package/sandboxels-1.13.2/index.html +21523 -0
  291. package/sandboxels-package/sandboxels-1.13.2/lang/README.txt +5 -0
  292. package/sandboxels-package/sandboxels-1.13.2/lang/af.json +1 -0
  293. package/sandboxels-package/sandboxels-1.13.2/lang/ar.json +1 -0
  294. package/sandboxels-package/sandboxels-1.13.2/lang/ar_sy.json +1 -0
  295. package/sandboxels-package/sandboxels-1.13.2/lang/bn.json +1 -0
  296. package/sandboxels-package/sandboxels-1.13.2/lang/ca.json +1 -0
  297. package/sandboxels-package/sandboxels-1.13.2/lang/cs.json +1 -0
  298. package/sandboxels-package/sandboxels-1.13.2/lang/da.json +1 -0
  299. package/sandboxels-package/sandboxels-1.13.2/lang/de.json +1 -0
  300. package/sandboxels-package/sandboxels-1.13.2/lang/el.json +1 -0
  301. package/sandboxels-package/sandboxels-1.13.2/lang/en.json +1 -0
  302. package/sandboxels-package/sandboxels-1.13.2/lang/en_au.json +1 -0
  303. package/sandboxels-package/sandboxels-1.13.2/lang/en_ca.json +1 -0
  304. package/sandboxels-package/sandboxels-1.13.2/lang/en_gb.json +1 -0
  305. package/sandboxels-package/sandboxels-1.13.2/lang/es.json +1 -0
  306. package/sandboxels-package/sandboxels-1.13.2/lang/et.json +1 -0
  307. package/sandboxels-package/sandboxels-1.13.2/lang/fi.json +1 -0
  308. package/sandboxels-package/sandboxels-1.13.2/lang/fil.json +1 -0
  309. package/sandboxels-package/sandboxels-1.13.2/lang/fr.json +1 -0
  310. package/sandboxels-package/sandboxels-1.13.2/lang/gen.js +21 -0
  311. package/sandboxels-package/sandboxels-1.13.2/lang/he.json +1 -0
  312. package/sandboxels-package/sandboxels-1.13.2/lang/hu.json +1 -0
  313. package/sandboxels-package/sandboxels-1.13.2/lang/id.json +1 -0
  314. package/sandboxels-package/sandboxels-1.13.2/lang/it.json +1 -0
  315. package/sandboxels-package/sandboxels-1.13.2/lang/ja.json +1 -0
  316. package/sandboxels-package/sandboxels-1.13.2/lang/ko.json +1 -0
  317. package/sandboxels-package/sandboxels-1.13.2/lang/la.json +1 -0
  318. package/sandboxels-package/sandboxels-1.13.2/lang/ne.json +1 -0
  319. package/sandboxels-package/sandboxels-1.13.2/lang/nl.json +1 -0
  320. package/sandboxels-package/sandboxels-1.13.2/lang/no.json +1 -0
  321. package/sandboxels-package/sandboxels-1.13.2/lang/pl.json +1 -0
  322. package/sandboxels-package/sandboxels-1.13.2/lang/pt.json +1 -0
  323. package/sandboxels-package/sandboxels-1.13.2/lang/pt_br.json +1 -0
  324. package/sandboxels-package/sandboxels-1.13.2/lang/qha.json +1 -0
  325. package/sandboxels-package/sandboxels-1.13.2/lang/qvp.json +1 -0
  326. package/sandboxels-package/sandboxels-1.13.2/lang/ro.json +1 -0
  327. package/sandboxels-package/sandboxels-1.13.2/lang/ru.json +1 -0
  328. package/sandboxels-package/sandboxels-1.13.2/lang/sr.json +1 -0
  329. package/sandboxels-package/sandboxels-1.13.2/lang/sv.json +1 -0
  330. package/sandboxels-package/sandboxels-1.13.2/lang/template.json +677 -0
  331. package/sandboxels-package/sandboxels-1.13.2/lang/th.json +1 -0
  332. package/sandboxels-package/sandboxels-1.13.2/lang/tok.json +1 -0
  333. package/sandboxels-package/sandboxels-1.13.2/lang/tok_old.json +543 -0
  334. package/sandboxels-package/sandboxels-1.13.2/lang/tr.json +1 -0
  335. package/sandboxels-package/sandboxels-1.13.2/lang/uk.json +1 -0
  336. package/sandboxels-package/sandboxels-1.13.2/lang/vi.json +1 -0
  337. package/sandboxels-package/sandboxels-1.13.2/lang/xem.json +1 -0
  338. package/sandboxels-package/sandboxels-1.13.2/lang/zh_cn.json +1 -0
  339. package/sandboxels-package/sandboxels-1.13.2/lang/zh_hant.json +1 -0
  340. package/sandboxels-package/sandboxels-1.13.2/license.txt +48 -0
  341. package/sandboxels-package/sandboxels-1.13.2/lite.html +1599 -0
  342. package/sandboxels-package/sandboxels-1.13.2/manifest.json +33 -0
  343. package/sandboxels-package/sandboxels-1.13.2/media.html +134 -0
  344. package/sandboxels-package/sandboxels-1.13.2/mobile-use.html +110 -0
  345. package/sandboxels-package/sandboxels-1.13.2/mod-list.html +535 -0
  346. package/sandboxels-package/sandboxels-1.13.2/mods/1.10example.js +118 -0
  347. package/sandboxels-package/sandboxels-1.13.2/mods/10kelements.js +172 -0
  348. package/sandboxels-package/sandboxels-1.13.2/mods/3pms_mod.js +144 -0
  349. package/sandboxels-package/sandboxels-1.13.2/mods/AnonymousWorldgenLibrary.js +55 -0
  350. package/sandboxels-package/sandboxels-1.13.2/mods/Batteries.js +288 -0
  351. package/sandboxels-package/sandboxels-1.13.2/mods/BlueStuff.js +681 -0
  352. package/sandboxels-package/sandboxels-1.13.2/mods/CandyCanes.js +15 -0
  353. package/sandboxels-package/sandboxels-1.13.2/mods/CandyCorn.js +8 -0
  354. package/sandboxels-package/sandboxels-1.13.2/mods/CherrySoda.js +77 -0
  355. package/sandboxels-package/sandboxels-1.13.2/mods/EasterEggs.js +1 -0
  356. package/sandboxels-package/sandboxels-1.13.2/mods/ExtraMachines.js +2338 -0
  357. package/sandboxels-package/sandboxels-1.13.2/mods/FoodFoodFood.js +114 -0
  358. package/sandboxels-package/sandboxels-1.13.2/mods/Gemstones.js +80 -0
  359. package/sandboxels-package/sandboxels-1.13.2/mods/GrapeSoda.js +141 -0
  360. package/sandboxels-package/sandboxels-1.13.2/mods/Humanitize.js +959 -0
  361. package/sandboxels-package/sandboxels-1.13.2/mods/Inators.js +108 -0
  362. package/sandboxels-package/sandboxels-1.13.2/mods/IreThings.js +169 -0
  363. package/sandboxels-package/sandboxels-1.13.2/mods/Lab.js +397 -0
  364. package/sandboxels-package/sandboxels-1.13.2/mods/LimesAdditions.js +401 -0
  365. package/sandboxels-package/sandboxels-1.13.2/mods/MarkusFoodMod.js +334 -0
  366. package/sandboxels-package/sandboxels-1.13.2/mods/Mucho_frio_y_Calor.js +16 -0
  367. package/sandboxels-package/sandboxels-1.13.2/mods/Natural_disasters.js +207 -0
  368. package/sandboxels-package/sandboxels-1.13.2/mods/Neutronium Mod.js +1228 -0
  369. package/sandboxels-package/sandboxels-1.13.2/mods/PRNGworldgenlib.js +526 -0
  370. package/sandboxels-package/sandboxels-1.13.2/mods/Quicksand_one.js +1355 -0
  371. package/sandboxels-package/sandboxels-1.13.2/mods/RF_transmitter_receiver.js +62 -0
  372. package/sandboxels-package/sandboxels-1.13.2/mods/Random_quicksands.js +932 -0
  373. package/sandboxels-package/sandboxels-1.13.2/mods/Science_mod.js +1791 -0
  374. package/sandboxels-package/sandboxels-1.13.2/mods/Shroomboxels.js +71 -0
  375. package/sandboxels-package/sandboxels-1.13.2/mods/SuperASAX_Funny_Mod.js +297 -0
  376. package/sandboxels-package/sandboxels-1.13.2/mods/Temperature+.js +47 -0
  377. package/sandboxels-package/sandboxels-1.13.2/mods/Thread.js +180 -0
  378. package/sandboxels-package/sandboxels-1.13.2/mods/UAMM.js +502 -0
  379. package/sandboxels-package/sandboxels-1.13.2/mods/Ultra_Steel.js +61 -0
  380. package/sandboxels-package/sandboxels-1.13.2/mods/UwUify.js +87 -0
  381. package/sandboxels-package/sandboxels-1.13.2/mods/VCR_OSD_MONO.ttf +0 -0
  382. package/sandboxels-package/sandboxels-1.13.2/mods/Vegan.js +255 -0
  383. package/sandboxels-package/sandboxels-1.13.2/mods/WhisperingTheory.js +213 -0
  384. package/sandboxels-package/sandboxels-1.13.2/mods/aChefsDream.js +8159 -0
  385. package/sandboxels-package/sandboxels-1.13.2/mods/aChefsDream2.js +815 -0
  386. package/sandboxels-package/sandboxels-1.13.2/mods/aChefsDream_beta.js +12 -0
  387. package/sandboxels-package/sandboxels-1.13.2/mods/aScientistsWish.js +1195 -0
  388. package/sandboxels-package/sandboxels-1.13.2/mods/a_bundle_of_tests.js +417 -0
  389. package/sandboxels-package/sandboxels-1.13.2/mods/a_mod_by_alice.js +46043 -0
  390. package/sandboxels-package/sandboxels-1.13.2/mods/acid_and_shapes.js +1 -0
  391. package/sandboxels-package/sandboxels-1.13.2/mods/adaceythings.js +343 -0
  392. package/sandboxels-package/sandboxels-1.13.2/mods/adjustablepixelsize.js +28 -0
  393. package/sandboxels-package/sandboxels-1.13.2/mods/advanced_colonies.js +146 -0
  394. package/sandboxels-package/sandboxels-1.13.2/mods/advancedbugs.js +37 -0
  395. package/sandboxels-package/sandboxels-1.13.2/mods/aircrafts.js +260 -0
  396. package/sandboxels-package/sandboxels-1.13.2/mods/alchem.js +372 -0
  397. package/sandboxels-package/sandboxels-1.13.2/mods/alchemy.js +69 -0
  398. package/sandboxels-package/sandboxels-1.13.2/mods/alcohol.js +113 -0
  399. package/sandboxels-package/sandboxels-1.13.2/mods/alkahest.js +33 -0
  400. package/sandboxels-package/sandboxels-1.13.2/mods/alkali_metal.js +308 -0
  401. package/sandboxels-package/sandboxels-1.13.2/mods/all_around_fillers.js +73 -0
  402. package/sandboxels-package/sandboxels-1.13.2/mods/all_stain.js +7 -0
  403. package/sandboxels-package/sandboxels-1.13.2/mods/allliquids.js +24 -0
  404. package/sandboxels-package/sandboxels-1.13.2/mods/amogus.js +69 -0
  405. package/sandboxels-package/sandboxels-1.13.2/mods/anmm.js +566 -0
  406. package/sandboxels-package/sandboxels-1.13.2/mods/ants.js +137 -0
  407. package/sandboxels-package/sandboxels-1.13.2/mods/apioforms_pre.js +238 -0
  408. package/sandboxels-package/sandboxels-1.13.2/mods/applestuff.js +80 -0
  409. package/sandboxels-package/sandboxels-1.13.2/mods/asciiboxels.js +231 -0
  410. package/sandboxels-package/sandboxels-1.13.2/mods/aussieAdditions.js +123 -0
  411. package/sandboxels-package/sandboxels-1.13.2/mods/baby.js +65 -0
  412. package/sandboxels-package/sandboxels-1.13.2/mods/background_changer.js +59 -0
  413. package/sandboxels-package/sandboxels-1.13.2/mods/bacteria_mod.js +121 -0
  414. package/sandboxels-package/sandboxels-1.13.2/mods/bananas.js +543 -0
  415. package/sandboxels-package/sandboxels-1.13.2/mods/barf_mod.js +42 -0
  416. package/sandboxels-package/sandboxels-1.13.2/mods/barista.js +209 -0
  417. package/sandboxels-package/sandboxels-1.13.2/mods/bere.js +85 -0
  418. package/sandboxels-package/sandboxels-1.13.2/mods/betterMenuScreens.js +279 -0
  419. package/sandboxels-package/sandboxels-1.13.2/mods/betterModManager.js +174 -0
  420. package/sandboxels-package/sandboxels-1.13.2/mods/betterSettings.js +304 -0
  421. package/sandboxels-package/sandboxels-1.13.2/mods/betterStats.js +55 -0
  422. package/sandboxels-package/sandboxels-1.13.2/mods/better_smooth_water.js +6 -0
  423. package/sandboxels-package/sandboxels-1.13.2/mods/betterelec.js +51 -0
  424. package/sandboxels-package/sandboxels-1.13.2/mods/bettergraygoo.js +1 -0
  425. package/sandboxels-package/sandboxels-1.13.2/mods/bettermetalscrap.js +37 -0
  426. package/sandboxels-package/sandboxels-1.13.2/mods/bf.js +394 -0
  427. package/sandboxels-package/sandboxels-1.13.2/mods/bfdi.js +145 -0
  428. package/sandboxels-package/sandboxels-1.13.2/mods/bigger_star_spawners.js +198 -0
  429. package/sandboxels-package/sandboxels-1.13.2/mods/biology.js +8694 -0
  430. package/sandboxels-package/sandboxels-1.13.2/mods/bioooze_and_pyrogens.js +264 -0
  431. package/sandboxels-package/sandboxels-1.13.2/mods/black_hole.js +43 -0
  432. package/sandboxels-package/sandboxels-1.13.2/mods/blocks.js +164 -0
  433. package/sandboxels-package/sandboxels-1.13.2/mods/boiling_things.js +540 -0
  434. package/sandboxels-package/sandboxels-1.13.2/mods/bojithekings_mod.js +377 -0
  435. package/sandboxels-package/sandboxels-1.13.2/mods/boompaste.js +76 -0
  436. package/sandboxels-package/sandboxels-1.13.2/mods/borders.js +76 -0
  437. package/sandboxels-package/sandboxels-1.13.2/mods/bouncing_balls.js +703 -0
  438. package/sandboxels-package/sandboxels-1.13.2/mods/broken_mod_test.js +1 -0
  439. package/sandboxels-package/sandboxels-1.13.2/mods/building.js +154 -0
  440. package/sandboxels-package/sandboxels-1.13.2/mods/buildingreplicator.js +210 -0
  441. package/sandboxels-package/sandboxels-1.13.2/mods/c_fighter_jet.js +449 -0
  442. package/sandboxels-package/sandboxels-1.13.2/mods/cannibal_cooking.js +620 -0
  443. package/sandboxels-package/sandboxels-1.13.2/mods/cash_n_more.js +58 -0
  444. package/sandboxels-package/sandboxels-1.13.2/mods/cat.js +100 -0
  445. package/sandboxels-package/sandboxels-1.13.2/mods/cells.js +376 -0
  446. package/sandboxels-package/sandboxels-1.13.2/mods/chalcopyrite.js +124 -0
  447. package/sandboxels-package/sandboxels-1.13.2/mods/chalk.js +499 -0
  448. package/sandboxels-package/sandboxels-1.13.2/mods/change.js +58 -0
  449. package/sandboxels-package/sandboxels-1.13.2/mods/changePixelDebug.js +9 -0
  450. package/sandboxels-package/sandboxels-1.13.2/mods/changeTempReactionParameter.js +73 -0
  451. package/sandboxels-package/sandboxels-1.13.2/mods/chaos.js +32 -0
  452. package/sandboxels-package/sandboxels-1.13.2/mods/charsonsmodbeta.js +494 -0
  453. package/sandboxels-package/sandboxels-1.13.2/mods/charsonsmoduno.js +2116 -0
  454. package/sandboxels-package/sandboxels-1.13.2/mods/chem.js +7877 -0
  455. package/sandboxels-package/sandboxels-1.13.2/mods/chemFormula.js +44 -0
  456. package/sandboxels-package/sandboxels-1.13.2/mods/chemFormulas.json +549 -0
  457. package/sandboxels-package/sandboxels-1.13.2/mods/cherries.js +543 -0
  458. package/sandboxels-package/sandboxels-1.13.2/mods/chess.js +1463 -0
  459. package/sandboxels-package/sandboxels-1.13.2/mods/children.js +14 -0
  460. package/sandboxels-package/sandboxels-1.13.2/mods/circuitcore.js +1914 -0
  461. package/sandboxels-package/sandboxels-1.13.2/mods/circuitcore_displays.js +157 -0
  462. package/sandboxels-package/sandboxels-1.13.2/mods/citybuilding.js +193 -0
  463. package/sandboxels-package/sandboxels-1.13.2/mods/classic_explosives.js +62 -0
  464. package/sandboxels-package/sandboxels-1.13.2/mods/classic_textures.js +196 -0
  465. package/sandboxels-package/sandboxels-1.13.2/mods/clf3.js +86 -0
  466. package/sandboxels-package/sandboxels-1.13.2/mods/clone_liquid.js +22 -0
  467. package/sandboxels-package/sandboxels-1.13.2/mods/clouds.js +103 -0
  468. package/sandboxels-package/sandboxels-1.13.2/mods/cmur.js +5195 -0
  469. package/sandboxels-package/sandboxels-1.13.2/mods/code_library.js +1827 -0
  470. package/sandboxels-package/sandboxels-1.13.2/mods/coffee.js +228 -0
  471. package/sandboxels-package/sandboxels-1.13.2/mods/cold_liquid_explosion.js +20 -0
  472. package/sandboxels-package/sandboxels-1.13.2/mods/cold_opposites.js +66 -0
  473. package/sandboxels-package/sandboxels-1.13.2/mods/coldblooded.js +729 -0
  474. package/sandboxels-package/sandboxels-1.13.2/mods/collab_mod.js +253 -0
  475. package/sandboxels-package/sandboxels-1.13.2/mods/colonies.js +574 -0
  476. package/sandboxels-package/sandboxels-1.13.2/mods/colorLED.js +38 -0
  477. package/sandboxels-package/sandboxels-1.13.2/mods/color_everything.js +3 -0
  478. package/sandboxels-package/sandboxels-1.13.2/mods/color_tools.js +297 -0
  479. package/sandboxels-package/sandboxels-1.13.2/mods/colored_lightbulbs.js +44 -0
  480. package/sandboxels-package/sandboxels-1.13.2/mods/combustion.js +416 -0
  481. package/sandboxels-package/sandboxels-1.13.2/mods/community_desserts.js +829 -0
  482. package/sandboxels-package/sandboxels-1.13.2/mods/content.js +131 -0
  483. package/sandboxels-package/sandboxels-1.13.2/mods/controllable_pixel.js +75 -0
  484. package/sandboxels-package/sandboxels-1.13.2/mods/controllable_pixel_test.js +161 -0
  485. package/sandboxels-package/sandboxels-1.13.2/mods/conveyance.js +95 -0
  486. package/sandboxels-package/sandboxels-1.13.2/mods/cooked_apple.js +26 -0
  487. package/sandboxels-package/sandboxels-1.13.2/mods/cookie_clicker.js +943 -0
  488. package/sandboxels-package/sandboxels-1.13.2/mods/cookingnstuff.js +1 -0
  489. package/sandboxels-package/sandboxels-1.13.2/mods/cool_tools.js +35 -0
  490. package/sandboxels-package/sandboxels-1.13.2/mods/copy_canvas.js +9 -0
  491. package/sandboxels-package/sandboxels-1.13.2/mods/copypaste.js +100 -0
  492. package/sandboxels-package/sandboxels-1.13.2/mods/coresbyp.js +90 -0
  493. package/sandboxels-package/sandboxels-1.13.2/mods/cpt_alt.js +241 -0
  494. package/sandboxels-package/sandboxels-1.13.2/mods/crimson.js +424 -0
  495. package/sandboxels-package/sandboxels-1.13.2/mods/cs_expanded.js +31 -0
  496. package/sandboxels-package/sandboxels-1.13.2/mods/cubesstuff.js +3329 -0
  497. package/sandboxels-package/sandboxels-1.13.2/mods/currency.js +246 -0
  498. package/sandboxels-package/sandboxels-1.13.2/mods/cursed_shader_by_jayd.js +90 -0
  499. package/sandboxels-package/sandboxels-1.13.2/mods/cursor.js +3 -0
  500. package/sandboxels-package/sandboxels-1.13.2/mods/cursor_shapes.js +149 -0
  501. package/sandboxels-package/sandboxels-1.13.2/mods/customBackground.js +45 -0
  502. package/sandboxels-package/sandboxels-1.13.2/mods/customexplosion.js +110 -0
  503. package/sandboxels-package/sandboxels-1.13.2/mods/customtemptools.js +50 -0
  504. package/sandboxels-package/sandboxels-1.13.2/mods/dalgonacandy.js +41 -0
  505. package/sandboxels-package/sandboxels-1.13.2/mods/datawire.js +238 -0
  506. package/sandboxels-package/sandboxels-1.13.2/mods/date_test.js +268 -0
  507. package/sandboxels-package/sandboxels-1.13.2/mods/death_count.js +35 -0
  508. package/sandboxels-package/sandboxels-1.13.2/mods/debris.js +75 -0
  509. package/sandboxels-package/sandboxels-1.13.2/mods/debrisable.js +1136 -0
  510. package/sandboxels-package/sandboxels-1.13.2/mods/debugRework.js +169 -0
  511. package/sandboxels-package/sandboxels-1.13.2/mods/delete_all_of_element.js +17 -0
  512. package/sandboxels-package/sandboxels-1.13.2/mods/deneme.js +70 -0
  513. package/sandboxels-package/sandboxels-1.13.2/mods/dependency_test.js +13 -0
  514. package/sandboxels-package/sandboxels-1.13.2/mods/descriptions.js +17 -0
  515. package/sandboxels-package/sandboxels-1.13.2/mods/devsnacks.js +193 -0
  516. package/sandboxels-package/sandboxels-1.13.2/mods/devtests.js +278 -0
  517. package/sandboxels-package/sandboxels-1.13.2/mods/discord_port.js +36 -0
  518. package/sandboxels-package/sandboxels-1.13.2/mods/doElectricity changes.js +55 -0
  519. package/sandboxels-package/sandboxels-1.13.2/mods/dogs.js +85 -0
  520. package/sandboxels-package/sandboxels-1.13.2/mods/doom.js +935 -0
  521. package/sandboxels-package/sandboxels-1.13.2/mods/doomsday.js +56 -0
  522. package/sandboxels-package/sandboxels-1.13.2/mods/drawPixels_change_test.js +39 -0
  523. package/sandboxels-package/sandboxels-1.13.2/mods/dried_food.js +38 -0
  524. package/sandboxels-package/sandboxels-1.13.2/mods/drill.js +261 -0
  525. package/sandboxels-package/sandboxels-1.13.2/mods/drills.js +760 -0
  526. package/sandboxels-package/sandboxels-1.13.2/mods/easysurvival.js +917 -0
  527. package/sandboxels-package/sandboxels-1.13.2/mods/edible_everything.js +7 -0
  528. package/sandboxels-package/sandboxels-1.13.2/mods/editTools.js +608 -0
  529. package/sandboxels-package/sandboxels-1.13.2/mods/eklegems.js +1313 -0
  530. package/sandboxels-package/sandboxels-1.13.2/mods/electricityTest.js +42 -0
  531. package/sandboxels-package/sandboxels-1.13.2/mods/elem3.js +352316 -0
  532. package/sandboxels-package/sandboxels-1.13.2/mods/elementEraser.js +40 -0
  533. package/sandboxels-package/sandboxels-1.13.2/mods/element_UI.js +140 -0
  534. package/sandboxels-package/sandboxels-1.13.2/mods/elementreplacer.js +12 -0
  535. package/sandboxels-package/sandboxels-1.13.2/mods/elementsManager.js +1212 -0
  536. package/sandboxels-package/sandboxels-1.13.2/mods/empty.js +7 -0
  537. package/sandboxels-package/sandboxels-1.13.2/mods/evenmoretemptools.js +42 -0
  538. package/sandboxels-package/sandboxels-1.13.2/mods/example_mod.js +89 -0
  539. package/sandboxels-package/sandboxels-1.13.2/mods/example_mod_old.js +84 -0
  540. package/sandboxels-package/sandboxels-1.13.2/mods/exoplanet.js +220 -0
  541. package/sandboxels-package/sandboxels-1.13.2/mods/explodeAtPlus.js +138 -0
  542. package/sandboxels-package/sandboxels-1.13.2/mods/explosionsound.js +19 -0
  543. package/sandboxels-package/sandboxels-1.13.2/mods/extra_element_info.js +79 -0
  544. package/sandboxels-package/sandboxels-1.13.2/mods/extrasaveslots.js +42 -0
  545. package/sandboxels-package/sandboxels-1.13.2/mods/fans.js +204 -0
  546. package/sandboxels-package/sandboxels-1.13.2/mods/fantastic_creatures.js +198 -0
  547. package/sandboxels-package/sandboxels-1.13.2/mods/fantasy_elements.js +800 -0
  548. package/sandboxels-package/sandboxels-1.13.2/mods/fast_lightmap.js +339 -0
  549. package/sandboxels-package/sandboxels-1.13.2/mods/fey_and_more.js +1678 -0
  550. package/sandboxels-package/sandboxels-1.13.2/mods/fill_script.js +42 -0
  551. package/sandboxels-package/sandboxels-1.13.2/mods/find.js +115 -0
  552. package/sandboxels-package/sandboxels-1.13.2/mods/fine_tuned_cloner.js +121 -0
  553. package/sandboxels-package/sandboxels-1.13.2/mods/fire_extinguisher.js +128 -0
  554. package/sandboxels-package/sandboxels-1.13.2/mods/fire_mod.js +565 -0
  555. package/sandboxels-package/sandboxels-1.13.2/mods/fire_slime.js +68 -0
  556. package/sandboxels-package/sandboxels-1.13.2/mods/fishin.js +519 -0
  557. package/sandboxels-package/sandboxels-1.13.2/mods/fission.js +68 -0
  558. package/sandboxels-package/sandboxels-1.13.2/mods/fission_physics.js +86 -0
  559. package/sandboxels-package/sandboxels-1.13.2/mods/fiveys_stuff.js +119 -0
  560. package/sandboxels-package/sandboxels-1.13.2/mods/flesh_infection.js +645 -0
  561. package/sandboxels-package/sandboxels-1.13.2/mods/flipflop.js +36 -0
  562. package/sandboxels-package/sandboxels-1.13.2/mods/flowers_and_forests.js +468 -0
  563. package/sandboxels-package/sandboxels-1.13.2/mods/flying_fish.js +49 -0
  564. package/sandboxels-package/sandboxels-1.13.2/mods/food_mods.js +15 -0
  565. package/sandboxels-package/sandboxels-1.13.2/mods/foodgalore +100 -0
  566. package/sandboxels-package/sandboxels-1.13.2/mods/fools+.js +299 -0
  567. package/sandboxels-package/sandboxels-1.13.2/mods/fools.js +99 -0
  568. package/sandboxels-package/sandboxels-1.13.2/mods/fools24.js +842 -0
  569. package/sandboxels-package/sandboxels-1.13.2/mods/fools25.js +350 -0
  570. package/sandboxels-package/sandboxels-1.13.2/mods/fossils.js +676 -0
  571. package/sandboxels-package/sandboxels-1.13.2/mods/fractals.js +156 -0
  572. package/sandboxels-package/sandboxels-1.13.2/mods/franklin.js +44 -0
  573. package/sandboxels-package/sandboxels-1.13.2/mods/freeTPS.js +19 -0
  574. package/sandboxels-package/sandboxels-1.13.2/mods/fueled_generators.js +131 -0
  575. package/sandboxels-package/sandboxels-1.13.2/mods/funny elements 2022-11-15.js +84 -0
  576. package/sandboxels-package/sandboxels-1.13.2/mods/funny_liquid.js +618 -0
  577. package/sandboxels-package/sandboxels-1.13.2/mods/funny_liquid_2.js +322 -0
  578. package/sandboxels-package/sandboxels-1.13.2/mods/funny_liquid_3.js +254 -0
  579. package/sandboxels-package/sandboxels-1.13.2/mods/funny_solid.js +163 -0
  580. package/sandboxels-package/sandboxels-1.13.2/mods/funnynames.js +320 -0
  581. package/sandboxels-package/sandboxels-1.13.2/mods/fwibblen.js +69 -0
  582. package/sandboxels-package/sandboxels-1.13.2/mods/gambling.js +94 -0
  583. package/sandboxels-package/sandboxels-1.13.2/mods/gameOfLife.js +83 -0
  584. package/sandboxels-package/sandboxels-1.13.2/mods/garn47.js +325 -0
  585. package/sandboxels-package/sandboxels-1.13.2/mods/gasdecay.js +31 -0
  586. package/sandboxels-package/sandboxels-1.13.2/mods/generative_mods.js +2479 -0
  587. package/sandboxels-package/sandboxels-1.13.2/mods/generator_prompt.js +166 -0
  588. package/sandboxels-package/sandboxels-1.13.2/mods/genetics.js +4038 -0
  589. package/sandboxels-package/sandboxels-1.13.2/mods/glenn_gases.js +411 -0
  590. package/sandboxels-package/sandboxels-1.13.2/mods/glow.js +130 -0
  591. package/sandboxels-package/sandboxels-1.13.2/mods/gradient_background_support.js +21 -0
  592. package/sandboxels-package/sandboxels-1.13.2/mods/graphite.js +460 -0
  593. package/sandboxels-package/sandboxels-1.13.2/mods/grav_mudstones.js +382 -0
  594. package/sandboxels-package/sandboxels-1.13.2/mods/gravity.js +40 -0
  595. package/sandboxels-package/sandboxels-1.13.2/mods/gravity_test.js +51 -0
  596. package/sandboxels-package/sandboxels-1.13.2/mods/greenitemsandmore.js +183 -0
  597. package/sandboxels-package/sandboxels-1.13.2/mods/guided_rocket.js +106 -0
  598. package/sandboxels-package/sandboxels-1.13.2/mods/halogen.js +384 -0
  599. package/sandboxels-package/sandboxels-1.13.2/mods/haseulite.js +1673 -0
  600. package/sandboxels-package/sandboxels-1.13.2/mods/heatglow.js +74 -0
  601. package/sandboxels-package/sandboxels-1.13.2/mods/heatshield.js +30 -0
  602. package/sandboxels-package/sandboxels-1.13.2/mods/hexagon.js +45 -0
  603. package/sandboxels-package/sandboxels-1.13.2/mods/hidden_ground.js +42 -0
  604. package/sandboxels-package/sandboxels-1.13.2/mods/hideandshowtools.js +18 -0
  605. package/sandboxels-package/sandboxels-1.13.2/mods/human_edit.js +725 -0
  606. package/sandboxels-package/sandboxels-1.13.2/mods/human_friendly_design.js +899 -0
  607. package/sandboxels-package/sandboxels-1.13.2/mods/humans.js +203 -0
  608. package/sandboxels-package/sandboxels-1.13.2/mods/hydroid.js +224 -0
  609. package/sandboxels-package/sandboxels-1.13.2/mods/icb.js +32 -0
  610. package/sandboxels-package/sandboxels-1.13.2/mods/iean.js +135 -0
  611. package/sandboxels-package/sandboxels-1.13.2/mods/immune.js +199 -0
  612. package/sandboxels-package/sandboxels-1.13.2/mods/incinerators.js +29 -0
  613. package/sandboxels-package/sandboxels-1.13.2/mods/industry.js +308 -0
  614. package/sandboxels-package/sandboxels-1.13.2/mods/infLiqLight.js +8 -0
  615. package/sandboxels-package/sandboxels-1.13.2/mods/injector.js +450 -0
  616. package/sandboxels-package/sandboxels-1.13.2/mods/insane_random_events.js +123 -0
  617. package/sandboxels-package/sandboxels-1.13.2/mods/invertscroll.js +8 -0
  618. package/sandboxels-package/sandboxels-1.13.2/mods/invisible_things.js +83 -0
  619. package/sandboxels-package/sandboxels-1.13.2/mods/iocalfaeus_clones.js +100 -0
  620. package/sandboxels-package/sandboxels-1.13.2/mods/jaydsfunctions.js +187 -0
  621. package/sandboxels-package/sandboxels-1.13.2/mods/jaydsmods.js +89 -0
  622. package/sandboxels-package/sandboxels-1.13.2/mods/jaydstuff.js +783 -0
  623. package/sandboxels-package/sandboxels-1.13.2/mods/junction.js +50 -0
  624. package/sandboxels-package/sandboxels-1.13.2/mods/ketchup_mod.js +526 -0
  625. package/sandboxels-package/sandboxels-1.13.2/mods/kopalsBar.js +175 -0
  626. package/sandboxels-package/sandboxels-1.13.2/mods/kopalstuff.js +541 -0
  627. package/sandboxels-package/sandboxels-1.13.2/mods/lactose_intolerance_and_celiac.js +18 -0
  628. package/sandboxels-package/sandboxels-1.13.2/mods/laetium.js +328 -0
  629. package/sandboxels-package/sandboxels-1.13.2/mods/lattice_filler.js +29 -0
  630. package/sandboxels-package/sandboxels-1.13.2/mods/lemonade.js +71 -0
  631. package/sandboxels-package/sandboxels-1.13.2/mods/libhooktick.js +49 -0
  632. package/sandboxels-package/sandboxels-1.13.2/mods/libpacman-v1.js +61 -0
  633. package/sandboxels-package/sandboxels-1.13.2/mods/libpixeltracking.js +29 -0
  634. package/sandboxels-package/sandboxels-1.13.2/mods/library_test.js +5 -0
  635. package/sandboxels-package/sandboxels-1.13.2/mods/life_eater.js +169 -0
  636. package/sandboxels-package/sandboxels-1.13.2/mods/light.js +218 -0
  637. package/sandboxels-package/sandboxels-1.13.2/mods/lighting_test.js +79 -0
  638. package/sandboxels-package/sandboxels-1.13.2/mods/lightmap.js +382 -0
  639. package/sandboxels-package/sandboxels-1.13.2/mods/limewater.js +75 -0
  640. package/sandboxels-package/sandboxels-1.13.2/mods/liquid_energy.js +294 -0
  641. package/sandboxels-package/sandboxels-1.13.2/mods/liquid_mixing.js +184 -0
  642. package/sandboxels-package/sandboxels-1.13.2/mods/liquid_void.js +29 -0
  643. package/sandboxels-package/sandboxels-1.13.2/mods/littlejohnny.js +72 -0
  644. package/sandboxels-package/sandboxels-1.13.2/mods/lizard_mod.js +91 -0
  645. package/sandboxels-package/sandboxels-1.13.2/mods/logicgates.js +482 -0
  646. package/sandboxels-package/sandboxels-1.13.2/mods/lone_urea.js +69 -0
  647. package/sandboxels-package/sandboxels-1.13.2/mods/lost_souls.js +177 -0
  648. package/sandboxels-package/sandboxels-1.13.2/mods/lye.js +34 -0
  649. package/sandboxels-package/sandboxels-1.13.2/mods/machines.js +293 -0
  650. package/sandboxels-package/sandboxels-1.13.2/mods/manyMoreThemes.js +67 -0
  651. package/sandboxels-package/sandboxels-1.13.2/mods/mars.js +473 -0
  652. package/sandboxels-package/sandboxels-1.13.2/mods/maxColorOffset.js +54 -0
  653. package/sandboxels-package/sandboxels-1.13.2/mods/maze.js +71 -0
  654. package/sandboxels-package/sandboxels-1.13.2/mods/meat_rockets.js +70 -0
  655. package/sandboxels-package/sandboxels-1.13.2/mods/memelists.js +17 -0
  656. package/sandboxels-package/sandboxels-1.13.2/mods/metals.js +791 -0
  657. package/sandboxels-package/sandboxels-1.13.2/mods/minecraft.js +818 -0
  658. package/sandboxels-package/sandboxels-1.13.2/mods/minesweeper.js +100 -0
  659. package/sandboxels-package/sandboxels-1.13.2/mods/miscellaneous_elements.js +278 -0
  660. package/sandboxels-package/sandboxels-1.13.2/mods/miscible_psoup_and_birthpool.js +7 -0
  661. package/sandboxels-package/sandboxels-1.13.2/mods/mix.js +65 -0
  662. package/sandboxels-package/sandboxels-1.13.2/mods/mixture.js +714 -0
  663. package/sandboxels-package/sandboxels-1.13.2/mods/mixtureII.js +440 -0
  664. package/sandboxels-package/sandboxels-1.13.2/mods/mjsstuff.js +233 -0
  665. package/sandboxels-package/sandboxels-1.13.2/mods/mobile_keybinds.js +33 -0
  666. package/sandboxels-package/sandboxels-1.13.2/mods/mobile_shift.js +336 -0
  667. package/sandboxels-package/sandboxels-1.13.2/mods/mobs.js +5147 -0
  668. package/sandboxels-package/sandboxels-1.13.2/mods/mod_for_mnem.js +1 -0
  669. package/sandboxels-package/sandboxels-1.13.2/mods/modlangs.js +53 -0
  670. package/sandboxels-package/sandboxels-1.13.2/mods/moreViews.js +473 -0
  671. package/sandboxels-package/sandboxels-1.13.2/mods/more_art_states.js +89 -0
  672. package/sandboxels-package/sandboxels-1.13.2/mods/more_breaking.js +189 -0
  673. package/sandboxels-package/sandboxels-1.13.2/mods/more_disasters.js +497 -0
  674. package/sandboxels-package/sandboxels-1.13.2/mods/more_gold.js +115 -0
  675. package/sandboxels-package/sandboxels-1.13.2/mods/morebombs.js +1143 -0
  676. package/sandboxels-package/sandboxels-1.13.2/mods/morechemistry.js +1764 -0
  677. package/sandboxels-package/sandboxels-1.13.2/mods/morefoodsmod.js +154 -0
  678. package/sandboxels-package/sandboxels-1.13.2/mods/moreliquids.js +138 -0
  679. package/sandboxels-package/sandboxels-1.13.2/mods/morepowders.js +335 -0
  680. package/sandboxels-package/sandboxels-1.13.2/mods/moretools.js +68 -0
  681. package/sandboxels-package/sandboxels-1.13.2/mods/moretrees.js +490 -0
  682. package/sandboxels-package/sandboxels-1.13.2/mods/mossstuff.js +2301 -0
  683. package/sandboxels-package/sandboxels-1.13.2/mods/mouthwash.js +23 -0
  684. package/sandboxels-package/sandboxels-1.13.2/mods/move_tools.js +71 -0
  685. package/sandboxels-package/sandboxels-1.13.2/mods/moveable_cubes.js +258 -0
  686. package/sandboxels-package/sandboxels-1.13.2/mods/moving_pixels.js +179 -0
  687. package/sandboxels-package/sandboxels-1.13.2/mods/mush_infection.js +321 -0
  688. package/sandboxels-package/sandboxels-1.13.2/mods/musicalfruit.js +4 -0
  689. package/sandboxels-package/sandboxels-1.13.2/mods/mustard.js +48 -0
  690. package/sandboxels-package/sandboxels-1.13.2/mods/mystic.js +274 -0
  691. package/sandboxels-package/sandboxels-1.13.2/mods/nastystuff.js +57 -0
  692. package/sandboxels-package/sandboxels-1.13.2/mods/nature_Mod.js +1384 -0
  693. package/sandboxels-package/sandboxels-1.13.2/mods/nekonicos_stuff.js +1651 -0
  694. package/sandboxels-package/sandboxels-1.13.2/mods/nested_for_reaction_example.js +19 -0
  695. package/sandboxels-package/sandboxels-1.13.2/mods/nettysaddon.js +48 -0
  696. package/sandboxels-package/sandboxels-1.13.2/mods/neutronium_compressor.js +416 -0
  697. package/sandboxels-package/sandboxels-1.13.2/mods/nicer_flame.js +48 -0
  698. package/sandboxels-package/sandboxels-1.13.2/mods/nirmod.js +296 -0
  699. package/sandboxels-package/sandboxels-1.13.2/mods/nitroglycerin.js +54 -0
  700. package/sandboxels-package/sandboxels-1.13.2/mods/no_blood.js +23 -0
  701. package/sandboxels-package/sandboxels-1.13.2/mods/no_radiation_events.js +3 -0
  702. package/sandboxels-package/sandboxels-1.13.2/mods/no_random_grbs.js +9 -0
  703. package/sandboxels-package/sandboxels-1.13.2/mods/no_scroll.js +5 -0
  704. package/sandboxels-package/sandboxels-1.13.2/mods/noblegas.js +215 -0
  705. package/sandboxels-package/sandboxels-1.13.2/mods/nocancer.js +9 -0
  706. package/sandboxels-package/sandboxels-1.13.2/mods/nocancer2.js +1 -0
  707. package/sandboxels-package/sandboxels-1.13.2/mods/noconfirm.js +1 -0
  708. package/sandboxels-package/sandboxels-1.13.2/mods/nograssgrow.js +6 -0
  709. package/sandboxels-package/sandboxels-1.13.2/mods/noita.js +4895 -0
  710. package/sandboxels-package/sandboxels-1.13.2/mods/noita_demake.js +430 -0
  711. package/sandboxels-package/sandboxels-1.13.2/mods/nopixellimit.js +2 -0
  712. package/sandboxels-package/sandboxels-1.13.2/mods/note_block.js +97 -0
  713. package/sandboxels-package/sandboxels-1.13.2/mods/note_block_advanced.js +628 -0
  714. package/sandboxels-package/sandboxels-1.13.2/mods/nousersthings.js +4081 -0
  715. package/sandboxels-package/sandboxels-1.13.2/mods/nuclear.js +300 -0
  716. package/sandboxels-package/sandboxels-1.13.2/mods/nv7.js +35013 -0
  717. package/sandboxels-package/sandboxels-1.13.2/mods/obsidian.js +51 -0
  718. package/sandboxels-package/sandboxels-1.13.2/mods/occlusion.js +149 -0
  719. package/sandboxels-package/sandboxels-1.13.2/mods/ocean.js +130 -0
  720. package/sandboxels-package/sandboxels-1.13.2/mods/ochem_prerelease.js +774 -0
  721. package/sandboxels-package/sandboxels-1.13.2/mods/oldTooltip.js +23 -0
  722. package/sandboxels-package/sandboxels-1.13.2/mods/oldleds.js +20 -0
  723. package/sandboxels-package/sandboxels-1.13.2/mods/onTryMoveInto.js +85 -0
  724. package/sandboxels-package/sandboxels-1.13.2/mods/onecolor.js +146 -0
  725. package/sandboxels-package/sandboxels-1.13.2/mods/orchidslibrary.js +70 -0
  726. package/sandboxels-package/sandboxels-1.13.2/mods/ores.js +232 -0
  727. package/sandboxels-package/sandboxels-1.13.2/mods/organism.js +915 -0
  728. package/sandboxels-package/sandboxels-1.13.2/mods/oxide.theme.js +46 -0
  729. package/sandboxels-package/sandboxels-1.13.2/mods/page_color.js +35 -0
  730. package/sandboxels-package/sandboxels-1.13.2/mods/paint_event.js +17 -0
  731. package/sandboxels-package/sandboxels-1.13.2/mods/periodic_and_more.js +64 -0
  732. package/sandboxels-package/sandboxels-1.13.2/mods/peta.js +214 -0
  733. package/sandboxels-package/sandboxels-1.13.2/mods/petal_dye.js +40 -0
  734. package/sandboxels-package/sandboxels-1.13.2/mods/pixelResizeTool.js +18 -0
  735. package/sandboxels-package/sandboxels-1.13.2/mods/pizzasstuff.js +2338 -0
  736. package/sandboxels-package/sandboxels-1.13.2/mods/place_all_elements.js +30 -0
  737. package/sandboxels-package/sandboxels-1.13.2/mods/placuchtestthing.js +17 -0
  738. package/sandboxels-package/sandboxels-1.13.2/mods/planet.js +270 -0
  739. package/sandboxels-package/sandboxels-1.13.2/mods/planet_cracker.js +81 -0
  740. package/sandboxels-package/sandboxels-1.13.2/mods/plants.js +1616 -0
  741. package/sandboxels-package/sandboxels-1.13.2/mods/plastic.js +93 -0
  742. package/sandboxels-package/sandboxels-1.13.2/mods/portal.js +120 -0
  743. package/sandboxels-package/sandboxels-1.13.2/mods/potato_chips.js +44 -0
  744. package/sandboxels-package/sandboxels-1.13.2/mods/prairie.js +200 -0
  745. package/sandboxels-package/sandboxels-1.13.2/mods/precisionDrawing.js +58 -0
  746. package/sandboxels-package/sandboxels-1.13.2/mods/pressure.js +223 -0
  747. package/sandboxels-package/sandboxels-1.13.2/mods/pressure_sensitive.js +20 -0
  748. package/sandboxels-package/sandboxels-1.13.2/mods/prideflags.js +307 -0
  749. package/sandboxels-package/sandboxels-1.13.2/mods/primordial_birthpool.js +38 -0
  750. package/sandboxels-package/sandboxels-1.13.2/mods/prompt.js +1215 -0
  751. package/sandboxels-package/sandboxels-1.13.2/mods/prop and prompt variables.js +16 -0
  752. package/sandboxels-package/sandboxels-1.13.2/mods/prop.js +466 -0
  753. package/sandboxels-package/sandboxels-1.13.2/mods/pullers.js +479 -0
  754. package/sandboxels-package/sandboxels-1.13.2/mods/purple_guys_mod.js +3635 -0
  755. package/sandboxels-package/sandboxels-1.13.2/mods/pushers.js +287 -0
  756. package/sandboxels-package/sandboxels-1.13.2/mods/radioactive.js +135 -0
  757. package/sandboxels-package/sandboxels-1.13.2/mods/rainbow_cursor.js +12 -0
  758. package/sandboxels-package/sandboxels-1.13.2/mods/rainbow_tests.js +348 -0
  759. package/sandboxels-package/sandboxels-1.13.2/mods/rainsmod.js +412 -0
  760. package/sandboxels-package/sandboxels-1.13.2/mods/random_elems.js +463 -0
  761. package/sandboxels-package/sandboxels-1.13.2/mods/random_everything.js +7 -0
  762. package/sandboxels-package/sandboxels-1.13.2/mods/random_fixes.js +42 -0
  763. package/sandboxels-package/sandboxels-1.13.2/mods/random_liquids.js +220 -0
  764. package/sandboxels-package/sandboxels-1.13.2/mods/random_rocks.js +164 -0
  765. package/sandboxels-package/sandboxels-1.13.2/mods/random_things.js +69 -0
  766. package/sandboxels-package/sandboxels-1.13.2/mods/randomelements.js +200 -0
  767. package/sandboxels-package/sandboxels-1.13.2/mods/randomness.js +730 -0
  768. package/sandboxels-package/sandboxels-1.13.2/mods/randomness_but_tick.js +1257 -0
  769. package/sandboxels-package/sandboxels-1.13.2/mods/randomness_but_tool.js +26 -0
  770. package/sandboxels-package/sandboxels-1.13.2/mods/ray_cloner.js +150 -0
  771. package/sandboxels-package/sandboxels-1.13.2/mods/rays++.js +60 -0
  772. package/sandboxels-package/sandboxels-1.13.2/mods/rays.js +464 -0
  773. package/sandboxels-package/sandboxels-1.13.2/mods/reactor_supplies_and_others.js +88 -0
  774. package/sandboxels-package/sandboxels-1.13.2/mods/real_light.js +754 -0
  775. package/sandboxels-package/sandboxels-1.13.2/mods/replace.js +79 -0
  776. package/sandboxels-package/sandboxels-1.13.2/mods/replace_all.js +45 -0
  777. package/sandboxels-package/sandboxels-1.13.2/mods/reverse_time.js +421 -0
  778. package/sandboxels-package/sandboxels-1.13.2/mods/rich_grain.js +54 -0
  779. package/sandboxels-package/sandboxels-1.13.2/mods/rising_powders.js +3 -0
  780. package/sandboxels-package/sandboxels-1.13.2/mods/rock_paper_scissors.js +32 -0
  781. package/sandboxels-package/sandboxels-1.13.2/mods/roseyiede.js +363 -0
  782. package/sandboxels-package/sandboxels-1.13.2/mods/rpg.js +1342 -0
  783. package/sandboxels-package/sandboxels-1.13.2/mods/ru_expanded.js +25 -0
  784. package/sandboxels-package/sandboxels-1.13.2/mods/runAfterAutogen and onload restructure.js +1 -0
  785. package/sandboxels-package/sandboxels-1.13.2/mods/runAfterAutogen2.js +56 -0
  786. package/sandboxels-package/sandboxels-1.13.2/mods/sandboxels.js +2501 -0
  787. package/sandboxels-package/sandboxels-1.13.2/mods/saturnsstuff.js +729 -0
  788. package/sandboxels-package/sandboxels-1.13.2/mods/save_loading.js +520 -0
  789. package/sandboxels-package/sandboxels-1.13.2/mods/sbmixup.js +1439 -0
  790. package/sandboxels-package/sandboxels-1.13.2/mods/sbstuff.js +1865 -0
  791. package/sandboxels-package/sandboxels-1.13.2/mods/scenexe.js +770 -0
  792. package/sandboxels-package/sandboxels-1.13.2/mods/schematics.js +214 -0
  793. package/sandboxels-package/sandboxels-1.13.2/mods/scp.js +7831 -0
  794. package/sandboxels-package/sandboxels-1.13.2/mods/selective_paint.js +60 -0
  795. package/sandboxels-package/sandboxels-1.13.2/mods/sensitive.js +20 -0
  796. package/sandboxels-package/sandboxels-1.13.2/mods/shade.js +46 -0
  797. package/sandboxels-package/sandboxels-1.13.2/mods/shader_by_jayd.js +168 -0
  798. package/sandboxels-package/sandboxels-1.13.2/mods/shipstuff.js +198 -0
  799. package/sandboxels-package/sandboxels-1.13.2/mods/singleColor.js +1 -0
  800. package/sandboxels-package/sandboxels-1.13.2/mods/single_humans.js +147 -0
  801. package/sandboxels-package/sandboxels-1.13.2/mods/sky.js +141 -0
  802. package/sandboxels-package/sandboxels-1.13.2/mods/slag_fix.js +25 -0
  803. package/sandboxels-package/sandboxels-1.13.2/mods/smooth_water.js +6 -0
  804. package/sandboxels-package/sandboxels-1.13.2/mods/solid_rock.js +74 -0
  805. package/sandboxels-package/sandboxels-1.13.2/mods/solidcolor.js +146 -0
  806. package/sandboxels-package/sandboxels-1.13.2/mods/solubility.js +287 -0
  807. package/sandboxels-package/sandboxels-1.13.2/mods/some_tf_liquids.js +358 -0
  808. package/sandboxels-package/sandboxels-1.13.2/mods/souls.js +163 -0
  809. package/sandboxels-package/sandboxels-1.13.2/mods/soups.js +104 -0
  810. package/sandboxels-package/sandboxels-1.13.2/mods/spaceship.js +138 -0
  811. package/sandboxels-package/sandboxels-1.13.2/mods/special_property_library.js +155 -0
  812. package/sandboxels-package/sandboxels-1.13.2/mods/sponge_edit.js +76 -0
  813. package/sandboxels-package/sandboxels-1.13.2/mods/sports_beta.js +69 -0
  814. package/sandboxels-package/sandboxels-1.13.2/mods/spouts.js +715 -0
  815. package/sandboxels-package/sandboxels-1.13.2/mods/spring.js +283 -0
  816. package/sandboxels-package/sandboxels-1.13.2/mods/stainless_steel.js +126 -0
  817. package/sandboxels-package/sandboxels-1.13.2/mods/star_wars.js +70 -0
  818. package/sandboxels-package/sandboxels-1.13.2/mods/state_voids.js +347 -0
  819. package/sandboxels-package/sandboxels-1.13.2/mods/static.js +182 -0
  820. package/sandboxels-package/sandboxels-1.13.2/mods/stickyslime.js +3 -0
  821. package/sandboxels-package/sandboxels-1.13.2/mods/stickystuff.js +59 -0
  822. package/sandboxels-package/sandboxels-1.13.2/mods/stormlib.js +99 -0
  823. package/sandboxels-package/sandboxels-1.13.2/mods/stripe_paint.js +110 -0
  824. package/sandboxels-package/sandboxels-1.13.2/mods/structure_test.js +755 -0
  825. package/sandboxels-package/sandboxels-1.13.2/mods/sturdierpowders.js +595 -0
  826. package/sandboxels-package/sandboxels-1.13.2/mods/subspace.js +46 -0
  827. package/sandboxels-package/sandboxels-1.13.2/mods/survival.js +499 -0
  828. package/sandboxels-package/sandboxels-1.13.2/mods/survivalhack.js +500 -0
  829. package/sandboxels-package/sandboxels-1.13.2/mods/sus.js +92 -0
  830. package/sandboxels-package/sandboxels-1.13.2/mods/switches.js +53 -0
  831. package/sandboxels-package/sandboxels-1.13.2/mods/talismanadditions.js +124 -0
  832. package/sandboxels-package/sandboxels-1.13.2/mods/tech.js +282 -0
  833. package/sandboxels-package/sandboxels-1.13.2/mods/test.js +8 -0
  834. package/sandboxels-package/sandboxels-1.13.2/mods/test_2.js +399 -0
  835. package/sandboxels-package/sandboxels-1.13.2/mods/testmod.js +7 -0
  836. package/sandboxels-package/sandboxels-1.13.2/mods/text.js +681 -0
  837. package/sandboxels-package/sandboxels-1.13.2/mods/texture_pack_by_jayd.js +116 -0
  838. package/sandboxels-package/sandboxels-1.13.2/mods/texturepack.js +94 -0
  839. package/sandboxels-package/sandboxels-1.13.2/mods/the_ground.js +3 -0
  840. package/sandboxels-package/sandboxels-1.13.2/mods/the_ground_og.js +2570 -0
  841. package/sandboxels-package/sandboxels-1.13.2/mods/the_snail.js +63 -0
  842. package/sandboxels-package/sandboxels-1.13.2/mods/themostrandomstuff.js +523 -0
  843. package/sandboxels-package/sandboxels-1.13.2/mods/thermal_conduit.js +157 -0
  844. package/sandboxels-package/sandboxels-1.13.2/mods/thiquovite.js +1745 -0
  845. package/sandboxels-package/sandboxels-1.13.2/mods/ticking_temp_stuff.js +494 -0
  846. package/sandboxels-package/sandboxels-1.13.2/mods/time.js +7 -0
  847. package/sandboxels-package/sandboxels-1.13.2/mods/toms_stuff.js +308 -0
  848. package/sandboxels-package/sandboxels-1.13.2/mods/tool_pixel_behavior.js +792 -0
  849. package/sandboxels-package/sandboxels-1.13.2/mods/tooltip.js +32 -0
  850. package/sandboxels-package/sandboxels-1.13.2/mods/toothpaste.js +154 -0
  851. package/sandboxels-package/sandboxels-1.13.2/mods/tpt.js +89 -0
  852. package/sandboxels-package/sandboxels-1.13.2/mods/triggerable_random_powders.js +68 -0
  853. package/sandboxels-package/sandboxels-1.13.2/mods/troll.js +170 -0
  854. package/sandboxels-package/sandboxels-1.13.2/mods/true_flashbang.js +520 -0
  855. package/sandboxels-package/sandboxels-1.13.2/mods/ultimadrink.js +3191 -0
  856. package/sandboxels-package/sandboxels-1.13.2/mods/uncook.js +51 -0
  857. package/sandboxels-package/sandboxels-1.13.2/mods/unhide.js +10 -0
  858. package/sandboxels-package/sandboxels-1.13.2/mods/variety_mod.js +727 -0
  859. package/sandboxels-package/sandboxels-1.13.2/mods/velocity.js +139 -0
  860. package/sandboxels-package/sandboxels-1.13.2/mods/velocity2.js +209 -0
  861. package/sandboxels-package/sandboxels-1.13.2/mods/video.js +125 -0
  862. package/sandboxels-package/sandboxels-1.13.2/mods/vinegar.js +17 -0
  863. package/sandboxels-package/sandboxels-1.13.2/mods/volcanic_expansion.js +94 -0
  864. package/sandboxels-package/sandboxels-1.13.2/mods/war.js +51 -0
  865. package/sandboxels-package/sandboxels-1.13.2/mods/war_crimes.js +131 -0
  866. package/sandboxels-package/sandboxels-1.13.2/mods/waterspout.js +26 -0
  867. package/sandboxels-package/sandboxels-1.13.2/mods/weAllScreamFor.js +218 -0
  868. package/sandboxels-package/sandboxels-1.13.2/mods/weapons.js +1286 -0
  869. package/sandboxels-package/sandboxels-1.13.2/mods/wheel_fix.js +19 -0
  870. package/sandboxels-package/sandboxels-1.13.2/mods/wifi.js +162 -0
  871. package/sandboxels-package/sandboxels-1.13.2/mods/wifi_draw.js +87 -0
  872. package/sandboxels-package/sandboxels-1.13.2/mods/wine.js +8 -0
  873. package/sandboxels-package/sandboxels-1.13.2/mods/wirelike_test.js +681 -0
  874. package/sandboxels-package/sandboxels-1.13.2/mods/worldEdit.js +441 -0
  875. package/sandboxels-package/sandboxels-1.13.2/mods/worldEdit.ts +569 -0
  876. package/sandboxels-package/sandboxels-1.13.2/mods/world_gen_test.js +315 -0
  877. package/sandboxels-package/sandboxels-1.13.2/mods/worldgen_test.js +173 -0
  878. package/sandboxels-package/sandboxels-1.13.2/mods/worldgenlibrary.js +164 -0
  879. package/sandboxels-package/sandboxels-1.13.2/mods/x_dependent_change_test.js +34 -0
  880. package/sandboxels-package/sandboxels-1.13.2/mods/yumcherries.js +543 -0
  881. package/sandboxels-package/sandboxels-1.13.2/mods/zonneschijn7.js +6 -0
  882. package/sandboxels-package/sandboxels-1.13.2/mods/zoom.js +322 -0
  883. package/sandboxels-package/sandboxels-1.13.2/offline-use.html +103 -0
  884. package/sandboxels-package/sandboxels-1.13.2/offline.html +1 -0
  885. package/sandboxels-package/sandboxels-1.13.2/presskit.html +165 -0
  886. package/sandboxels-package/sandboxels-1.13.2/promo.html +13 -0
  887. package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/code.go +116 -0
  888. package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/go.mod +5 -0
  889. package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/go.sum +2 -0
  890. package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/main.go +58 -0
  891. package/sandboxels-package/sandboxels-1.13.2/scripts/perlin.js +165 -0
  892. package/sandboxels-package/sandboxels-1.13.2/service-worker.js +16 -0
  893. package/sandboxels-package/sandboxels-1.13.2/sitemap.txt +13 -0
  894. package/sandboxels-package/sandboxels-1.13.2/style.css +1105 -0
  895. package/sandboxels-package/sandboxels-1.13.2/template.html +86 -0
  896. package/sandboxels-package/sandboxels-1.13.2/tips.html +147 -0
  897. package/sandboxels-package/sandboxels-1.13.2/translate.html +105 -0
  898. package/README.md +0 -3
@@ -0,0 +1,4038 @@
1
+ /* by nekonico, do not steal!!!!!! >:3*/
2
+
3
+ elements.organism = {
4
+ behavior: [
5
+ "XX|XX|XX",
6
+ "XX|XX|XX",
7
+ "M2%10|M1|M2%10",
8
+ ],
9
+ color: ["#997457","#a89a76"],
10
+ properties: {
11
+ geneticCode: 0,
12
+ oldvore: 0,
13
+ vore: 0,
14
+ food: 0,
15
+ age: 0,
16
+ dead: false
17
+ },
18
+ tick: function(pixel) {
19
+ if (pixel.vore != pixel.oldvore) {
20
+ if (pixel.vore === 0) {
21
+ if (Math.random() > 0.5) {
22
+ pixel.color = "#997457"
23
+ }
24
+ else {
25
+ pixel.color = "#a89a76"
26
+ }
27
+ }
28
+ else if (pixel.vore === 1) {
29
+ if (Math.random() > 0.5) {
30
+ pixel.color = "#9E6954"
31
+ }
32
+ else {
33
+ pixel.color = "#AB8C6B"
34
+ }
35
+ }
36
+ else if (pixel.vore === 2) {
37
+ if (Math.random() > 0.5) {
38
+ pixel.color = "#A25F50"
39
+ }
40
+ else {
41
+ pixel.color = "#AF7E61"
42
+ }
43
+ }
44
+ else if (pixel.vore === 3) {
45
+ if (Math.random() > 0.5) {
46
+ pixel.color = "#A7544D"
47
+ }
48
+ else {
49
+ pixel.color = "#B27056"
50
+ }
51
+ }
52
+ else if (pixel.vore === 4) {
53
+ if (Math.random() > 0.5) {
54
+ pixel.color = "#A7544D"
55
+ }
56
+ else {
57
+ pixel.color = "#B5624B"
58
+ }
59
+ }
60
+ else if (pixel.vore === 5) {
61
+ if (Math.random() > 0.5) {
62
+ pixel.color = "#AC4A4A"
63
+ }
64
+ else {
65
+ pixel.color = "#B85440"
66
+ }
67
+ }
68
+ else if (pixel.vore === 6) {
69
+ if (Math.random() > 0.5) {
70
+ pixel.color = "#B03F47"
71
+ }
72
+ else {
73
+ pixel.color = "#BC4636"
74
+ }
75
+ }
76
+ else if (pixel.vore === 7) {
77
+ if (Math.random() > 0.5) {
78
+ pixel.color = "#B53543"
79
+ }
80
+ else {
81
+ pixel.color = "#BF382B"
82
+ }
83
+ }
84
+ else if (pixel.vore === 8) {
85
+ if (Math.random() > 0.5) {
86
+ pixel.color = "#B92A40"
87
+ }
88
+ else {
89
+ pixel.color = "#C22A20"
90
+ }
91
+ }
92
+ else if (pixel.vore > 8) {
93
+ if (Math.random() > 0.5) {
94
+ pixel.color = "#BE203D"
95
+ }
96
+ else {
97
+ pixel.color = "#C51C15"
98
+ }
99
+ }
100
+ else if (pixel.vore === -1) {
101
+ if (Math.random() > 0.5) {
102
+ pixel.color = "#8B7C4F"
103
+ }
104
+ else {
105
+ pixel.color = "#9D9A6B"
106
+ }
107
+ }
108
+ else if (pixel.vore === -2) {
109
+ if (Math.random() > 0.5) {
110
+ pixel.color = "#7D8447"
111
+ }
112
+ else {
113
+ pixel.color = "#939A61"
114
+ }
115
+ }
116
+ else if (pixel.vore === -3) {
117
+ if (Math.random() > 0.5) {
118
+ pixel.color = "#6F8C3F"
119
+ }
120
+ else {
121
+ pixel.color = "#889A56"
122
+ }
123
+ }
124
+ else if (pixel.vore === -4) {
125
+ if (Math.random() > 0.5) {
126
+ pixel.color = "#619437"
127
+ }
128
+ else {
129
+ pixel.color = "#7D9A4B"
130
+ }
131
+ }
132
+ else if (pixel.vore === -5) {
133
+ if (Math.random() > 0.5) {
134
+ pixel.color = "#539C2F"
135
+ }
136
+ else {
137
+ pixel.color = "#739A40"
138
+ }
139
+ }
140
+ else if (pixel.vore === -6) {
141
+ if (Math.random() > 0.5) {
142
+ pixel.color = "#46A428"
143
+ }
144
+ else {
145
+ pixel.color = "#689936"
146
+ }
147
+ }
148
+ else if (pixel.vore === -7) {
149
+ if (Math.random() > 0.5) {
150
+ pixel.color = "#38AC20"
151
+ }
152
+ else {
153
+ pixel.color = "#5E992B"
154
+ }
155
+ }
156
+ else if (pixel.vore === -8) {
157
+ if (Math.random() > 0.5) {
158
+ pixel.color = "#2AB418"
159
+ }
160
+ else {
161
+ pixel.color = "#539920"
162
+ }
163
+ }
164
+ else if (pixel.vore < -8) {
165
+ if (Math.random() > 0.5) {
166
+ pixel.color = "#1CBC10"
167
+ }
168
+ else {
169
+ pixel.color = "#489915"
170
+ }
171
+ }
172
+ }
173
+ if (pixel.food > 0 && Math.random() > 0.99) {
174
+ pixel.food -= 1;
175
+ }
176
+ else if (pixel.food < 1 && pixel.age > 1000 && Math.random() > 0.99) {
177
+ pixel.dead = true;
178
+ }
179
+ if (pixel.geneticCode < 11) {
180
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") {
181
+ deletePixel(pixel.x, pixel.y-1);
182
+ pixel.food += 1
183
+ }
184
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") {
185
+ deletePixel(pixel.x+1, pixel.y);
186
+ pixel.food += 1
187
+ }
188
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") {
189
+ deletePixel(pixel.x-1, pixel.y);
190
+ pixel.food += 1
191
+ }
192
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
193
+ createPixel("organism", pixel.x, pixel.y-1);
194
+ pixel.food -= 5;
195
+ if (Math.random() > 0.8) {
196
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
197
+ }
198
+ else {
199
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
200
+ }
201
+ }
202
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
203
+ createPixel("organism", pixel.x+1, pixel.y);
204
+ pixel.food -= 5;
205
+ if (Math.random() > 0.8) {
206
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
207
+ }
208
+ else {
209
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
210
+ }
211
+ }
212
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
213
+ createPixel("organism", pixel.x-1, pixel.y);
214
+ pixel.food -= 5;
215
+ if (Math.random() > 0.8) {
216
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
217
+ }
218
+ else {
219
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
220
+ }
221
+ }
222
+ if (pixel.age > 10000 || pixel.dead === true) {
223
+ if (Math.random() > 0.3) {
224
+ changePixel(pixel,"sugar");
225
+ }
226
+ else if (Math.random() > 0.5) {
227
+ changePixel(pixel,"dna");
228
+ }
229
+ }
230
+ pixel.age += 1
231
+ }
232
+ else if (pixel.geneticCode > 10 && pixel.geneticCode < 21) {
233
+ if (isEmpty(pixel.x, pixel.y+1)) {
234
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1);
235
+ }
236
+ else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) {
237
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
238
+ }
239
+ else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) {
240
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
241
+ }
242
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") {
243
+ deletePixel(pixel.x, pixel.y-1);
244
+ pixel.food += 1
245
+ }
246
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") {
247
+ deletePixel(pixel.x, pixel.y+1);
248
+ pixel.food += 1
249
+ }
250
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") {
251
+ deletePixel(pixel.x+1, pixel.y);
252
+ pixel.food += 1
253
+ }
254
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") {
255
+ deletePixel(pixel.x-1, pixel.y);
256
+ pixel.food += 1
257
+ }
258
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
259
+ createPixel("organism", pixel.x, pixel.y-1);
260
+ pixel.food -= 5;
261
+ if (Math.random() > 0.8) {
262
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
263
+ }
264
+ if (Math.random() < 0.2) {
265
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
266
+ }
267
+ else {
268
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
269
+ }
270
+ }
271
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
272
+ createPixel("organism", pixel.x+1, pixel.y);
273
+ pixel.food -= 5;
274
+ if (Math.random() > 0.8) {
275
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
276
+ }
277
+ if (Math.random() < 0.2) {
278
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
279
+ }
280
+ else {
281
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
282
+ }
283
+ }
284
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
285
+ createPixel("organism", pixel.x-1, pixel.y);
286
+ pixel.food -= 5;
287
+ if (Math.random() > 0.8) {
288
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
289
+ }
290
+ if (Math.random() < 0.2) {
291
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
292
+ }
293
+ else {
294
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
295
+ }
296
+ }
297
+ if (pixel.age > 10000 || pixel.dead === true) {
298
+ if (Math.random() > 0.3) {
299
+ if (pixel.vore > 0) {
300
+ changePixel(pixel,"meat");
301
+ }
302
+ else if (pixel.vore < 0) {
303
+ changePixel(pixel,"grass");
304
+ }
305
+ else if (pixel.vore === 0) {
306
+ changePixel(pixel,"sugar");
307
+ }
308
+ }
309
+ else if (Math.random() > 0.5) {
310
+ changePixel(pixel,"sugar");
311
+ }
312
+ }
313
+ pixel.age += 1
314
+ }
315
+ else if (pixel.geneticCode > 20 && pixel.geneticCode < 31) {
316
+ if (Math.random() > 0.95 && isEmpty(pixel.x-1, pixel.y)) {
317
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
318
+ }
319
+ else if (Math.random() > 0.95 && isEmpty(pixel.x+1, pixel.y)) {
320
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
321
+ }
322
+ if (pixel.vore > -3 && pixel.vore < 3) {
323
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") {
324
+ deletePixel(pixel.x, pixel.y-1);
325
+ pixel.food += 1
326
+ }
327
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") {
328
+ deletePixel(pixel.x, pixel.y+1);
329
+ pixel.food += 1
330
+ }
331
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") {
332
+ deletePixel(pixel.x+1, pixel.y);
333
+ pixel.food += 1
334
+ }
335
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") {
336
+ deletePixel(pixel.x-1, pixel.y);
337
+ pixel.food += 1
338
+ }
339
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
340
+ deletePixel(pixel.x, pixel.y-1);
341
+ pixel.food += 1
342
+ }
343
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
344
+ deletePixel(pixel.x, pixel.y+1);
345
+ pixel.food += 1
346
+ }
347
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
348
+ deletePixel(pixel.x+1, pixel.y);
349
+ pixel.food += 1
350
+ }
351
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
352
+ deletePixel(pixel.x-1, pixel.y);
353
+ pixel.food += 1
354
+ }
355
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
356
+ deletePixel(pixel.x, pixel.y-1);
357
+ pixel.food += 1
358
+ }
359
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
360
+ deletePixel(pixel.x, pixel.y+1);
361
+ pixel.food += 1
362
+ }
363
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
364
+ deletePixel(pixel.x+1, pixel.y);
365
+ pixel.food += 1
366
+ }
367
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
368
+ deletePixel(pixel.x-1, pixel.y);
369
+ pixel.food += 1
370
+ }
371
+ }
372
+ else if (pixel.vore > 2) {
373
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
374
+ deletePixel(pixel.x, pixel.y-1);
375
+ pixel.food += 1
376
+ }
377
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
378
+ deletePixel(pixel.x, pixel.y+1);
379
+ pixel.food += 1
380
+ }
381
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
382
+ deletePixel(pixel.x+1, pixel.y);
383
+ pixel.food += 1
384
+ }
385
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
386
+ deletePixel(pixel.x-1, pixel.y);
387
+ pixel.food += 1
388
+ }
389
+ }
390
+ else if (pixel.vore < -2) {
391
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
392
+ deletePixel(pixel.x, pixel.y-1);
393
+ pixel.food += 1
394
+ }
395
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
396
+ deletePixel(pixel.x, pixel.y+1);
397
+ pixel.food += 1
398
+ }
399
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
400
+ deletePixel(pixel.x+1, pixel.y);
401
+ pixel.food += 1
402
+ }
403
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
404
+ deletePixel(pixel.x-1, pixel.y);
405
+ pixel.food += 1
406
+ }
407
+ }
408
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
409
+ createPixel("organism", pixel.x, pixel.y-1);
410
+ pixel.food -= 5;
411
+ if (Math.random() > 0.8) {
412
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
413
+ }
414
+ if (Math.random() < 0.2) {
415
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
416
+ }
417
+ else {
418
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
419
+ }
420
+ if (Math.random() > 0.8) {
421
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
422
+ }
423
+ if (Math.random() < 0.2) {
424
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
425
+ }
426
+ else {
427
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
428
+ }
429
+ }
430
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
431
+ createPixel("organism", pixel.x+1, pixel.y);
432
+ pixel.food -= 5;
433
+ if (Math.random() > 0.8) {
434
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
435
+ }
436
+ if (Math.random() < 0.2) {
437
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
438
+ }
439
+ else {
440
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
441
+ }
442
+ if (Math.random() > 0.8) {
443
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
444
+ }
445
+ if (Math.random() < 0.2) {
446
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
447
+ }
448
+ else {
449
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
450
+ }
451
+ }
452
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
453
+ createPixel("organism", pixel.x-1, pixel.y);
454
+ pixel.food -= 5;
455
+ if (Math.random() > 0.8) {
456
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
457
+ }
458
+ if (Math.random() < 0.2) {
459
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
460
+ }
461
+ else {
462
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
463
+ }
464
+ if (Math.random() > 0.8) {
465
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
466
+ }
467
+ if (Math.random() < 0.2 ) {
468
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
469
+ }
470
+ else {
471
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
472
+ }
473
+ }
474
+ if (pixel.age > 10000 || pixel.dead === true) {
475
+ if (Math.random() > 0.3) {
476
+ if (pixel.vore > 0) {
477
+ changePixel(pixel,"meat");
478
+ }
479
+ else if (pixel.vore < 0) {
480
+ changePixel(pixel,"grass");
481
+ }
482
+ else if (pixel.vore === 0) {
483
+ changePixel(pixel,"sugar");
484
+ }
485
+ }
486
+ else if (Math.random() > 0.5) {
487
+ changePixel(pixel,"sugar");
488
+ }
489
+ }
490
+ pixel.age += 1
491
+ }
492
+ else if (pixel.geneticCode > 30 && pixel.geneticCode < 41) {
493
+ if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) {
494
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
495
+ }
496
+ else if (Math.random() > 0.9 && isEmpty(pixel.x+1, pixel.y)) {
497
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
498
+ }
499
+ if (pixel.vore > -3 && pixel.vore < 3) {
500
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") {
501
+ deletePixel(pixel.x, pixel.y-1);
502
+ pixel.food += 1
503
+ }
504
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") {
505
+ deletePixel(pixel.x, pixel.y+1);
506
+ pixel.food += 1
507
+ }
508
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") {
509
+ deletePixel(pixel.x+1, pixel.y);
510
+ pixel.food += 1
511
+ }
512
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") {
513
+ deletePixel(pixel.x-1, pixel.y);
514
+ pixel.food += 1
515
+ }
516
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
517
+ deletePixel(pixel.x, pixel.y-1);
518
+ pixel.food += 1
519
+ }
520
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
521
+ deletePixel(pixel.x, pixel.y+1);
522
+ pixel.food += 1
523
+ }
524
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
525
+ deletePixel(pixel.x+1, pixel.y);
526
+ pixel.food += 1
527
+ }
528
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
529
+ deletePixel(pixel.x-1, pixel.y);
530
+ pixel.food += 1
531
+ }
532
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
533
+ deletePixel(pixel.x, pixel.y-1);
534
+ pixel.food += 1
535
+ }
536
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
537
+ deletePixel(pixel.x, pixel.y+1);
538
+ pixel.food += 1
539
+ }
540
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
541
+ deletePixel(pixel.x+1, pixel.y);
542
+ pixel.food += 1
543
+ }
544
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
545
+ deletePixel(pixel.x-1, pixel.y);
546
+ pixel.food += 1
547
+ }
548
+ }
549
+ else if (pixel.vore > 2) {
550
+ /* by nekonico, do not steal!!!!!! >:3*/ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
551
+ deletePixel(pixel.x, pixel.y-1);
552
+ pixel.food += 1
553
+ }
554
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
555
+ deletePixel(pixel.x, pixel.y+1);
556
+ pixel.food += 1
557
+ }
558
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
559
+ deletePixel(pixel.x+1, pixel.y);
560
+ pixel.food += 1
561
+ }
562
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
563
+ deletePixel(pixel.x-1, pixel.y);
564
+ pixel.food += 1
565
+ }
566
+ }
567
+ else if (pixel.vore < -2) {
568
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
569
+ deletePixel(pixel.x, pixel.y-1);
570
+ pixel.food += 1
571
+ }
572
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
573
+ deletePixel(pixel.x, pixel.y+1);
574
+ pixel.food += 1
575
+ }
576
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
577
+ deletePixel(pixel.x+1, pixel.y);
578
+ pixel.food += 1
579
+ }
580
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
581
+ deletePixel(pixel.x-1, pixel.y);
582
+ pixel.food += 1
583
+ }
584
+ }
585
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
586
+ createPixel("organism", pixel.x, pixel.y-1);
587
+ pixel.food -= 5;
588
+ if (Math.random() > 0.8) {
589
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
590
+ }
591
+ if (Math.random() < 0.2) {
592
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
593
+ }
594
+ else {
595
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
596
+ }
597
+ if (Math.random() > 0.8) {
598
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
599
+ }
600
+ if (Math.random() < 0.2) {
601
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
602
+ }
603
+ else {
604
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
605
+ }
606
+ }
607
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
608
+ createPixel("organism", pixel.x+1, pixel.y);
609
+ pixel.food -= 5;
610
+ if (Math.random() > 0.8) {
611
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
612
+ }
613
+ if (Math.random() < 0.2) {
614
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
615
+ }
616
+ else {
617
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
618
+ }
619
+ if (Math.random() > 0.8) {
620
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
621
+ }
622
+ if (Math.random() < 0.2) {
623
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
624
+ }
625
+ else {
626
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
627
+ }
628
+ }
629
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
630
+ createPixel("organism", pixel.x-1, pixel.y);
631
+ pixel.food -= 5;
632
+ if (Math.random() > 0.8) {
633
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
634
+ }
635
+ if (Math.random() < 0.2) {
636
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
637
+ }
638
+ else {
639
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
640
+ }
641
+ if (Math.random() > 0.8) {
642
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
643
+ }
644
+ if (Math.random() < 0.2) {
645
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
646
+ }
647
+ else {
648
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
649
+ }
650
+ }
651
+ if (pixel.age > 10000 || pixel.dead === true) {
652
+ if (Math.random() > 0.3) {
653
+ if (pixel.vore > 0) {
654
+ changePixel(pixel,"rotten_meat");
655
+ }
656
+ else if (pixel.vore < 0) {
657
+ changePixel(pixel,"dead_plant");
658
+ }
659
+ else if (pixel.vore === 0) {
660
+ changePixel(pixel,"sugar");
661
+ }
662
+ }
663
+ else if (Math.random() > 0.5) {
664
+ if (pixel.vore > 0) {
665
+ changePixel(pixel,"meat");
666
+ }
667
+ else if (pixel.vore < 0) {
668
+ changePixel(pixel,"grass");
669
+ }
670
+ else if (pixel.vore === 0) {
671
+ changePixel(pixel,"sugar");
672
+ }
673
+ }
674
+ }
675
+ pixel.age += 1
676
+ }
677
+ else if (pixel.geneticCode > 40 && pixel.geneticCode < 51) {
678
+ if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) {
679
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
680
+ }
681
+ else if (Math.random() > 0.9 && isEmpty(pixel.x+1, pixel.y)) {
682
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
683
+ }
684
+ if (pixel.vore > -3 && pixel.vore < 3) {
685
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") {
686
+ deletePixel(pixel.x, pixel.y-1);
687
+ pixel.food += 1
688
+ }
689
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") {
690
+ deletePixel(pixel.x, pixel.y+1);
691
+ pixel.food += 1
692
+ }
693
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") {
694
+ deletePixel(pixel.x+1, pixel.y);
695
+ pixel.food += 1
696
+ }
697
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") {
698
+ deletePixel(pixel.x-1, pixel.y);
699
+ pixel.food += 1
700
+ }
701
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
702
+ deletePixel(pixel.x, pixel.y-1);
703
+ pixel.food += 1
704
+ }
705
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
706
+ deletePixel(pixel.x, pixel.y+1);
707
+ pixel.food += 1
708
+ }
709
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
710
+ deletePixel(pixel.x+1, pixel.y);
711
+ pixel.food += 1
712
+ }
713
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
714
+ deletePixel(pixel.x-1, pixel.y);
715
+ pixel.food += 1
716
+ }
717
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
718
+ deletePixel(pixel.x, pixel.y-1);
719
+ pixel.food += 1
720
+ }
721
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
722
+ deletePixel(pixel.x, pixel.y+1);
723
+ pixel.food += 1
724
+ }
725
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
726
+ deletePixel(pixel.x+1, pixel.y);
727
+ pixel.food += 1
728
+ }
729
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
730
+ deletePixel(pixel.x-1, pixel.y);
731
+ pixel.food += 1
732
+ }
733
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
734
+ deletePixel(pixel.x, pixel.y-1);
735
+ pixel.food += 1
736
+ }
737
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
738
+ deletePixel(pixel.x, pixel.y+1);
739
+ pixel.food += 1
740
+ }
741
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
742
+ deletePixel(pixel.x+1, pixel.y);
743
+ pixel.food += 1
744
+ }
745
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
746
+ deletePixel(pixel.x-1, pixel.y);
747
+ pixel.food += 1
748
+ }
749
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
750
+ deletePixel(pixel.x, pixel.y-1);
751
+ pixel.food += 1
752
+ }
753
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
754
+ deletePixel(pixel.x, pixel.y+1);
755
+ pixel.food += 1
756
+ }
757
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
758
+ deletePixel(pixel.x+1, pixel.y);
759
+ pixel.food += 1
760
+ }
761
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
762
+ deletePixel(pixel.x-1, pixel.y);
763
+ pixel.food += 1
764
+ }
765
+ }
766
+ else if (pixel.vore > 2) {
767
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
768
+ deletePixel(pixel.x, pixel.y-1);
769
+ pixel.food += 1
770
+ }
771
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
772
+ deletePixel(pixel.x, pixel.y+1);
773
+ pixel.food += 1
774
+ }
775
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
776
+ deletePixel(pixel.x+1, pixel.y);
777
+ pixel.food += 1
778
+ }
779
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
780
+ deletePixel(pixel.x-1, pixel.y);
781
+ pixel.food += 1
782
+ }
783
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
784
+ deletePixel(pixel.x, pixel.y-1);
785
+ pixel.food += 1
786
+ }
787
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
788
+ deletePixel(pixel.x, pixel.y+1);
789
+ pixel.food += 1
790
+ }
791
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
792
+ deletePixel(pixel.x+1, pixel.y);
793
+ pixel.food += 1
794
+ }
795
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
796
+ deletePixel(pixel.x-1, pixel.y);
797
+ pixel.food += 1
798
+ }
799
+ }
800
+ else if (pixel.vore < -2) {
801
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
802
+ deletePixel(pixel.x, pixel.y-1);
803
+ pixel.food += 1
804
+ }
805
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
806
+ deletePixel(pixel.x, pixel.y+1);
807
+ pixel.food += 1
808
+ }
809
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
810
+ deletePixel(pixel.x+1, pixel.y);
811
+ pixel.food += 1
812
+ }
813
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
814
+ deletePixel(pixel.x-1, pixel.y);
815
+ pixel.food += 1
816
+ }
817
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
818
+ deletePixel(pixel.x, pixel.y-1);
819
+ pixel.food += 1
820
+ }
821
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
822
+ deletePixel(pixel.x, pixel.y+1);
823
+ pixel.food += 1
824
+ }
825
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
826
+ deletePixel(pixel.x+1, pixel.y);
827
+ pixel.food += 1
828
+ }
829
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
830
+ deletePixel(pixel.x-1, pixel.y);
831
+ pixel.food += 1
832
+ }
833
+ }
834
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
835
+ createPixel("organism", pixel.x, pixel.y-1);
836
+ pixel.food -= 5;
837
+ if (Math.random() > 0.8) {
838
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
839
+ }
840
+ if (Math.random() < 0.2) {
841
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
842
+ }
843
+ else {
844
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
845
+ }
846
+ if (Math.random() > 0.8) {
847
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
848
+ }
849
+ if (Math.random() < 0.2) {
850
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
851
+ }
852
+ else {
853
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
854
+ }
855
+ }
856
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
857
+ createPixel("organism", pixel.x+1, pixel.y);
858
+ pixel.food -= 5;
859
+ if (Math.random() > 0.8) {
860
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
861
+ }
862
+ if (Math.random() < 0.2) {
863
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
864
+ }
865
+ else {
866
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
867
+ }
868
+ if (Math.random() > 0.8) {
869
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
870
+ }
871
+ if (Math.random() < 0.2) {
872
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
873
+ }
874
+ else {
875
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
876
+ }
877
+ }
878
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
879
+ createPixel("organism", pixel.x-1, pixel.y);
880
+ pixel.food -= 5;
881
+ if (Math.random() > 0.8) {
882
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
883
+ }
884
+ if (Math.random() < 0.2) {
885
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
886
+ }
887
+ else {
888
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
889
+ }
890
+ if (Math.random() > 0.8) {
891
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
892
+ }
893
+ if (Math.random() < 0.2) {
894
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
895
+ }
896
+ else {
897
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
898
+ }
899
+ }
900
+ if (pixel.age > 10000 || pixel.dead === true) {
901
+ if (Math.random() > 0.3) {
902
+ if (pixel.vore > 0) {
903
+ changePixel(pixel,"rotten_meat");
904
+ }
905
+ else if (pixel.vore < 0) {
906
+ changePixel(pixel,"dead_plant");
907
+ }
908
+ else if (pixel.vore === 0) {
909
+ changePixel(pixel,"sugar");
910
+ }
911
+ }
912
+ else if (Math.random() > 0.5) {
913
+ if (pixel.vore > 0) {
914
+ changePixel(pixel,"meat");
915
+ }
916
+ else if (pixel.vore < 0) {
917
+ changePixel(pixel,"grass");
918
+ }
919
+ else if (pixel.vore === 0) {
920
+ changePixel(pixel,"sugar");
921
+ }
922
+ }
923
+ }
924
+ pixel.age += 1
925
+ }
926
+ else if (pixel.geneticCode > 50 && pixel.geneticCode < 61) {
927
+ if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) {
928
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
929
+ }
930
+ else if (Math.random() > 0.8 && isEmpty(pixel.x+1, pixel.y)) {
931
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
932
+ }
933
+ if (pixel.vore > -3 && pixel.vore < 3) {
934
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") {
935
+ deletePixel(pixel.x, pixel.y-1);
936
+ pixel.food += 1
937
+ }
938
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") {
939
+ deletePixel(pixel.x, pixel.y+1);
940
+ pixel.food += 1
941
+ }
942
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") {
943
+ deletePixel(pixel.x+1, pixel.y);
944
+ pixel.food += 1
945
+ }
946
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") {
947
+ deletePixel(pixel.x-1, pixel.y);
948
+ pixel.food += 1
949
+ }
950
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
951
+ deletePixel(pixel.x, pixel.y-1);
952
+ pixel.food += 1
953
+ }
954
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
955
+ deletePixel(pixel.x, pixel.y+1);
956
+ pixel.food += 1
957
+ }
958
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
959
+ deletePixel(pixel.x+1, pixel.y);
960
+ pixel.food += 1
961
+ }
962
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
963
+ deletePixel(pixel.x-1, pixel.y);
964
+ pixel.food += 1
965
+ }
966
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
967
+ deletePixel(pixel.x, pixel.y-1);
968
+ pixel.food += 1
969
+ }
970
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
971
+ deletePixel(pixel.x, pixel.y+1);
972
+ pixel.food += 1
973
+ }
974
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
975
+ deletePixel(pixel.x+1, pixel.y);
976
+ pixel.food += 1
977
+ }
978
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
979
+ deletePixel(pixel.x-1, pixel.y);
980
+ pixel.food += 1
981
+ }
982
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
983
+ deletePixel(pixel.x, pixel.y-1);
984
+ pixel.food += 1
985
+ }
986
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
987
+ deletePixel(pixel.x, pixel.y+1);
988
+ pixel.food += 1
989
+ }
990
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
991
+ deletePixel(pixel.x+1, pixel.y);
992
+ pixel.food += 1
993
+ }
994
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
995
+ deletePixel(pixel.x-1, pixel.y);
996
+ pixel.food += 1
997
+ }
998
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
999
+ deletePixel(pixel.x, pixel.y-1);
1000
+ pixel.food += 1
1001
+ }
1002
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
1003
+ deletePixel(pixel.x, pixel.y+1);
1004
+ pixel.food += 1
1005
+ }
1006
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
1007
+ deletePixel(pixel.x+1, pixel.y);
1008
+ pixel.food += 1
1009
+ }
1010
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
1011
+ deletePixel(pixel.x-1, pixel.y);
1012
+ pixel.food += 1
1013
+ }
1014
+ }
1015
+ else if (pixel.vore > 2) {
1016
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
1017
+ deletePixel(pixel.x, pixel.y-1);
1018
+ pixel.food += 1
1019
+ }
1020
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
1021
+ deletePixel(pixel.x, pixel.y+1);
1022
+ pixel.food += 1
1023
+ }
1024
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
1025
+ deletePixel(pixel.x+1, pixel.y);
1026
+ pixel.food += 1
1027
+ }
1028
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
1029
+ deletePixel(pixel.x-1, pixel.y);
1030
+ pixel.food += 1
1031
+ }
1032
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
1033
+ deletePixel(pixel.x, pixel.y-1);
1034
+ pixel.food += 1
1035
+ }
1036
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
1037
+ deletePixel(pixel.x, pixel.y+1);
1038
+ pixel.food += 1
1039
+ }
1040
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
1041
+ deletePixel(pixel.x+1, pixel.y);
1042
+ pixel.food += 1
1043
+ }
1044
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
1045
+ deletePixel(pixel.x-1, pixel.y);
1046
+ pixel.food += 1
1047
+ }
1048
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") {
1049
+ deletePixel(pixel.x, pixel.y-1);
1050
+ pixel.food += 1
1051
+ }
1052
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") {
1053
+ deletePixel(pixel.x, pixel.y+1);
1054
+ pixel.food += 1
1055
+ }
1056
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") {
1057
+ deletePixel(pixel.x+1, pixel.y);
1058
+ pixel.food += 1
1059
+ }
1060
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") {
1061
+ deletePixel(pixel.x-1, pixel.y);
1062
+ pixel.food += 1
1063
+ }
1064
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") {
1065
+ deletePixel(pixel.x, pixel.y-1);
1066
+ pixel.food += 1
1067
+ }
1068
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") {
1069
+ deletePixel(pixel.x, pixel.y+1);
1070
+ pixel.food += 1
1071
+ }
1072
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") {
1073
+ deletePixel(pixel.x+1, pixel.y);
1074
+ pixel.food += 1
1075
+ }
1076
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") {
1077
+ deletePixel(pixel.x-1, pixel.y);
1078
+ pixel.food += 1
1079
+ }
1080
+ }
1081
+ else if (pixel.vore < -2) {
1082
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1083
+ deletePixel(pixel.x, pixel.y-1);
1084
+ pixel.food += 1
1085
+ }
1086
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1087
+ deletePixel(pixel.x, pixel.y+1);
1088
+ pixel.food += 1
1089
+ }
1090
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1091
+ deletePixel(pixel.x+1, pixel.y);
1092
+ pixel.food += 1
1093
+ }
1094
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1095
+ deletePixel(pixel.x-1, pixel.y);
1096
+ pixel.food += 1
1097
+ }
1098
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1099
+ deletePixel(pixel.x, pixel.y-1);
1100
+ pixel.food += 1
1101
+ }
1102
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1103
+ deletePixel(pixel.x, pixel.y+1);
1104
+ pixel.food += 1
1105
+ }
1106
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1107
+ deletePixel(pixel.x+1, pixel.y);
1108
+ pixel.food += 1
1109
+ }
1110
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1111
+ deletePixel(pixel.x-1, pixel.y);
1112
+ pixel.food += 1
1113
+ }
1114
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
1115
+ deletePixel(pixel.x, pixel.y-1);
1116
+ pixel.food += 1
1117
+ }
1118
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
1119
+ deletePixel(pixel.x, pixel.y+1);
1120
+ pixel.food += 1
1121
+ }
1122
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
1123
+ deletePixel(pixel.x+1, pixel.y);
1124
+ pixel.food += 1
1125
+ }
1126
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
1127
+ deletePixel(pixel.x-1, pixel.y);
1128
+ pixel.food += 1
1129
+ }
1130
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
1131
+ deletePixel(pixel.x, pixel.y-1);
1132
+ pixel.food += 1
1133
+ }
1134
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
1135
+ deletePixel(pixel.x, pixel.y+1);
1136
+ pixel.food += 1
1137
+ }
1138
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
1139
+ deletePixel(pixel.x+1, pixel.y);
1140
+ pixel.food += 1
1141
+ }
1142
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
1143
+ deletePixel(pixel.x-1, pixel.y);
1144
+ pixel.food += 1
1145
+ }
1146
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
1147
+ deletePixel(pixel.x, pixel.y-1);
1148
+ pixel.food += 1
1149
+ }
1150
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
1151
+ deletePixel(pixel.x, pixel.y+1);
1152
+ pixel.food += 1
1153
+ }
1154
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
1155
+ deletePixel(pixel.x+1, pixel.y);
1156
+ pixel.food += 1
1157
+ }
1158
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
1159
+ deletePixel(pixel.x-1, pixel.y);
1160
+ pixel.food += 1
1161
+ }
1162
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") {
1163
+ deletePixel(pixel.x, pixel.y-1);
1164
+ pixel.food += 1
1165
+ }
1166
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") {
1167
+ deletePixel(pixel.x, pixel.y+1);
1168
+ pixel.food += 1
1169
+ }
1170
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") {
1171
+ deletePixel(pixel.x+1, pixel.y);
1172
+ pixel.food += 1
1173
+ }
1174
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") {
1175
+ deletePixel(pixel.x-1, pixel.y);
1176
+ pixel.food += 1
1177
+ }
1178
+ }
1179
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
1180
+ createPixel("organism", pixel.x, pixel.y-1);
1181
+ pixel.food -= 5;
1182
+ if (Math.random() > 0.8) {
1183
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
1184
+ }
1185
+ if (Math.random() < 0.2) {
1186
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
1187
+ }
1188
+ else {
1189
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
1190
+ }
1191
+ if (Math.random() > 0.8) {
1192
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
1193
+ }
1194
+ if (Math.random() < 0.2) {
1195
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
1196
+ }
1197
+ else {
1198
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
1199
+ }
1200
+ }
1201
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
1202
+ createPixel("organism", pixel.x+1, pixel.y);
1203
+ pixel.food -= 5;
1204
+ if (Math.random() > 0.8) {
1205
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
1206
+ }
1207
+ if (Math.random() < 0.2) {
1208
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
1209
+ }
1210
+ else {
1211
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
1212
+ }
1213
+ if (Math.random() > 0.8) {
1214
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
1215
+ }
1216
+ if (Math.random() < 0.2) {
1217
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
1218
+ }
1219
+ else {
1220
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
1221
+ }
1222
+ }
1223
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
1224
+ createPixel("organism", pixel.x-1, pixel.y);
1225
+ pixel.food -= 5;
1226
+ if (Math.random() > 0.8) {
1227
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
1228
+ }
1229
+ if (Math.random() < 0.2) {
1230
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
1231
+ }
1232
+ else {
1233
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
1234
+ }
1235
+ if (Math.random() > 0.8) {
1236
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
1237
+ }
1238
+ if (Math.random() < 0.2) {
1239
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
1240
+ }
1241
+ else {
1242
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
1243
+ }
1244
+ }
1245
+ if (pixel.age > 10000 || pixel.dead === true) {
1246
+ if (Math.random() > 0.3) {
1247
+ if (pixel.vore > 0) {
1248
+ changePixel(pixel,"rotten_meat");
1249
+ }
1250
+ else if (pixel.vore < 0) {
1251
+ changePixel(pixel,"dead_plant");
1252
+ }
1253
+ else if (pixel.vore === 0) {
1254
+ changePixel(pixel,"sugar");
1255
+ }
1256
+ }
1257
+ else if (Math.random() > 0.5) {
1258
+ if (pixel.vore > 0) {
1259
+ changePixel(pixel,"meat");
1260
+ }
1261
+ else if (pixel.vore < 0) {
1262
+ changePixel(pixel,"grass");
1263
+ }
1264
+ else if (pixel.vore === 0) {
1265
+ changePixel(pixel,"sugar");
1266
+ }
1267
+ }
1268
+ }
1269
+ pixel.age += 1
1270
+ }
1271
+ else if (pixel.geneticCode > 60 && pixel.geneticCode < 71) {
1272
+ if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) {
1273
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
1274
+ }
1275
+ else if (Math.random() > 0.8 && isEmpty(pixel.x+1, pixel.y)) {
1276
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
1277
+ }
1278
+ if (pixel.vore > -3 && pixel.vore < 3) {
1279
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") {
1280
+ deletePixel(pixel.x, pixel.y-1);
1281
+ pixel.food += 1
1282
+ }
1283
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") {
1284
+ deletePixel(pixel.x, pixel.y+1);
1285
+ pixel.food += 1
1286
+ }
1287
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") {
1288
+ deletePixel(pixel.x+1, pixel.y);
1289
+ pixel.food += 1
1290
+ }
1291
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") {
1292
+ deletePixel(pixel.x-1, pixel.y);
1293
+ pixel.food += 1
1294
+ }
1295
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
1296
+ deletePixel(pixel.x, pixel.y-1);
1297
+ pixel.food += 1
1298
+ }
1299
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
1300
+ deletePixel(pixel.x, pixel.y+1);
1301
+ pixel.food += 1
1302
+ }
1303
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
1304
+ deletePixel(pixel.x+1, pixel.y);
1305
+ pixel.food += 1
1306
+ }
1307
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
1308
+ deletePixel(pixel.x-1, pixel.y);
1309
+ pixel.food += 1
1310
+ }
1311
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
1312
+ deletePixel(pixel.x, pixel.y-1);
1313
+ pixel.food += 1
1314
+ }
1315
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
1316
+ deletePixel(pixel.x, pixel.y+1);
1317
+ pixel.food += 1
1318
+ }
1319
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
1320
+ deletePixel(pixel.x+1, pixel.y);
1321
+ pixel.food += 1
1322
+ }
1323
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
1324
+ deletePixel(pixel.x-1, pixel.y);
1325
+ pixel.food += 1
1326
+ }
1327
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1328
+ deletePixel(pixel.x, pixel.y-1);
1329
+ pixel.food += 1
1330
+ }
1331
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1332
+ deletePixel(pixel.x, pixel.y+1);
1333
+ pixel.food += 1
1334
+ }
1335
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1336
+ deletePixel(pixel.x+1, pixel.y);
1337
+ pixel.food += 1
1338
+ }
1339
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1340
+ deletePixel(pixel.x-1, pixel.y);
1341
+ pixel.food += 1
1342
+ }
1343
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
1344
+ deletePixel(pixel.x, pixel.y-1);
1345
+ pixel.food += 1
1346
+ }
1347
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
1348
+ deletePixel(pixel.x, pixel.y+1);
1349
+ pixel.food += 1
1350
+ }
1351
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
1352
+ deletePixel(pixel.x+1, pixel.y);
1353
+ pixel.food += 1
1354
+ }
1355
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
1356
+ deletePixel(pixel.x-1, pixel.y);
1357
+ pixel.food += 1
1358
+ }
1359
+ }
1360
+ else if (pixel.vore > 2) {
1361
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
1362
+ deletePixel(pixel.x, pixel.y-1);
1363
+ pixel.food += 1
1364
+ }
1365
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
1366
+ deletePixel(pixel.x, pixel.y+1);
1367
+ pixel.food += 1
1368
+ }
1369
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
1370
+ deletePixel(pixel.x+1, pixel.y);
1371
+ pixel.food += 1
1372
+ }
1373
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
1374
+ deletePixel(pixel.x-1, pixel.y);
1375
+ pixel.food += 1
1376
+ }
1377
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
1378
+ deletePixel(pixel.x, pixel.y-1);
1379
+ pixel.food += 1
1380
+ }
1381
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
1382
+ deletePixel(pixel.x, pixel.y+1);
1383
+ pixel.food += 1
1384
+ }
1385
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
1386
+ deletePixel(pixel.x+1, pixel.y);
1387
+ pixel.food += 1
1388
+ }
1389
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
1390
+ deletePixel(pixel.x-1, pixel.y);
1391
+ pixel.food += 1
1392
+ }
1393
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") {
1394
+ deletePixel(pixel.x, pixel.y-1);
1395
+ pixel.food += 1
1396
+ }
1397
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") {
1398
+ deletePixel(pixel.x, pixel.y+1);
1399
+ pixel.food += 1
1400
+ }
1401
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") {
1402
+ deletePixel(pixel.x+1, pixel.y);
1403
+ pixel.food += 1
1404
+ }
1405
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") {
1406
+ deletePixel(pixel.x-1, pixel.y);
1407
+ pixel.food += 1
1408
+ }
1409
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") {
1410
+ deletePixel(pixel.x, pixel.y-1);
1411
+ pixel.food += 1
1412
+ }
1413
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") {
1414
+ deletePixel(pixel.x, pixel.y+1);
1415
+ pixel.food += 1
1416
+ }
1417
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") {
1418
+ deletePixel(pixel.x+1, pixel.y);
1419
+ pixel.food += 1
1420
+ }
1421
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") {
1422
+ deletePixel(pixel.x-1, pixel.y);
1423
+ pixel.food += 1
1424
+ }
1425
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") {
1426
+ deletePixel(pixel.x, pixel.y-1);
1427
+ pixel.food += 1
1428
+ }
1429
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") {
1430
+ deletePixel(pixel.x, pixel.y+1);
1431
+ pixel.food += 1
1432
+ }
1433
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") {
1434
+ deletePixel(pixel.x+1, pixel.y);
1435
+ pixel.food += 1
1436
+ }
1437
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") {
1438
+ deletePixel(pixel.x-1, pixel.y);
1439
+ pixel.food += 1
1440
+ }
1441
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") {
1442
+ deletePixel(pixel.x, pixel.y-1);
1443
+ pixel.food += 1
1444
+ }
1445
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") {
1446
+ deletePixel(pixel.x, pixel.y+1);
1447
+ pixel.food += 1
1448
+ }
1449
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") {
1450
+ deletePixel(pixel.x+1, pixel.y);
1451
+ pixel.food += 1
1452
+ }
1453
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") {
1454
+ deletePixel(pixel.x-1, pixel.y);
1455
+ pixel.food += 1
1456
+ }
1457
+ }
1458
+ else if (pixel.vore < -2) {
1459
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1460
+ deletePixel(pixel.x, pixel.y-1);
1461
+ pixel.food += 1
1462
+ }
1463
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1464
+ deletePixel(pixel.x, pixel.y+1);
1465
+ pixel.food += 1
1466
+ }
1467
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1468
+ deletePixel(pixel.x+1, pixel.y);
1469
+ pixel.food += 1
1470
+ }
1471
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1472
+ deletePixel(pixel.x-1, pixel.y);
1473
+ pixel.food += 1
1474
+ }
1475
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1476
+ deletePixel(pixel.x, pixel.y-1);
1477
+ pixel.food += 1
1478
+ }
1479
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1480
+ deletePixel(pixel.x, pixel.y+1);
1481
+ pixel.food += 1
1482
+ }
1483
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1484
+ deletePixel(pixel.x+1, pixel.y);
1485
+ pixel.food += 1
1486
+ }
1487
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1488
+ deletePixel(pixel.x-1, pixel.y);
1489
+ pixel.food += 1
1490
+ }
1491
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
1492
+ deletePixel(pixel.x, pixel.y-1);
1493
+ pixel.food += 1
1494
+ }
1495
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
1496
+ deletePixel(pixel.x, pixel.y+1);
1497
+ pixel.food += 1
1498
+ }
1499
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
1500
+ deletePixel(pixel.x+1, pixel.y);
1501
+ pixel.food += 1
1502
+ }
1503
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
1504
+ deletePixel(pixel.x-1, pixel.y);
1505
+ pixel.food += 1
1506
+ }
1507
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
1508
+ deletePixel(pixel.x, pixel.y-1);
1509
+ pixel.food += 1
1510
+ }
1511
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
1512
+ deletePixel(pixel.x, pixel.y+1);
1513
+ pixel.food += 1
1514
+ }
1515
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
1516
+ deletePixel(pixel.x+1, pixel.y);
1517
+ pixel.food += 1
1518
+ }
1519
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
1520
+ deletePixel(pixel.x-1, pixel.y);
1521
+ pixel.food += 1
1522
+ }
1523
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
1524
+ deletePixel(pixel.x, pixel.y-1);
1525
+ pixel.food += 1
1526
+ }
1527
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
1528
+ deletePixel(pixel.x, pixel.y+1);
1529
+ pixel.food += 1
1530
+ }
1531
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
1532
+ deletePixel(pixel.x+1, pixel.y);
1533
+ pixel.food += 1
1534
+ }
1535
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
1536
+ deletePixel(pixel.x-1, pixel.y);
1537
+ pixel.food += 1
1538
+ }
1539
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") {
1540
+ deletePixel(pixel.x, pixel.y-1);
1541
+ pixel.food += 1
1542
+ }
1543
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") {
1544
+ deletePixel(pixel.x, pixel.y+1);
1545
+ pixel.food += 1
1546
+ }
1547
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") {
1548
+ deletePixel(pixel.x+1, pixel.y);
1549
+ pixel.food += 1
1550
+ }
1551
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") {
1552
+ deletePixel(pixel.x-1, pixel.y);
1553
+ pixel.food += 1
1554
+ }
1555
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") {
1556
+ deletePixel(pixel.x, pixel.y-1);
1557
+ pixel.food += 1
1558
+ }
1559
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") {
1560
+ deletePixel(pixel.x, pixel.y+1);
1561
+ pixel.food += 1
1562
+ }
1563
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") {
1564
+ deletePixel(pixel.x+1, pixel.y);
1565
+ pixel.food += 1
1566
+ }
1567
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") {
1568
+ deletePixel(pixel.x-1, pixel.y);
1569
+ pixel.food += 1
1570
+ }
1571
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") {
1572
+ deletePixel(pixel.x, pixel.y-1);
1573
+ pixel.food += 1
1574
+ }
1575
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") {
1576
+ deletePixel(pixel.x, pixel.y+1);
1577
+ pixel.food += 1
1578
+ }
1579
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") {
1580
+ deletePixel(pixel.x+1, pixel.y);
1581
+ pixel.food += 1
1582
+ }
1583
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") {
1584
+ deletePixel(pixel.x-1, pixel.y);
1585
+ pixel.food += 1
1586
+ }
1587
+ }
1588
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
1589
+ createPixel("organism", pixel.x, pixel.y-1);
1590
+ pixel.food -= 5;
1591
+ if (Math.random() > 0.8) {
1592
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
1593
+ }
1594
+ if (Math.random() < 0.2) {
1595
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
1596
+ }
1597
+ else {
1598
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
1599
+ }
1600
+ if (Math.random() > 0.8) {
1601
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
1602
+ }
1603
+ if (Math.random() < 0.2) {
1604
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
1605
+ }
1606
+ else {
1607
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
1608
+ }
1609
+ }
1610
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
1611
+ createPixel("organism", pixel.x+1, pixel.y);
1612
+ pixel.food -= 5;
1613
+ if (Math.random() > 0.8) {
1614
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
1615
+ }
1616
+ if (Math.random() < 0.2) {
1617
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
1618
+ }
1619
+ else {
1620
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
1621
+ }
1622
+ if (Math.random() > 0.8) {
1623
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
1624
+ }
1625
+ if (Math.random() < 0.2) {
1626
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
1627
+ }
1628
+ else {
1629
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
1630
+ }
1631
+ }
1632
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
1633
+ createPixel("organism", pixel.x-1, pixel.y);
1634
+ pixel.food -= 5;
1635
+ if (Math.random() > 0.8) {
1636
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
1637
+ }
1638
+ if (Math.random() < 0.2) {
1639
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
1640
+ }
1641
+ else {
1642
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
1643
+ }
1644
+ if (Math.random() > 0.8) {
1645
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
1646
+ }
1647
+ if (Math.random() < 0.2) {
1648
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
1649
+ }
1650
+ else {
1651
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
1652
+ }
1653
+ }
1654
+ if (pixel.age > 10000 || pixel.dead === true) {
1655
+ if (Math.random() > 0.3) {
1656
+ if (pixel.vore > 0) {
1657
+ changePixel(pixel,"rotten_meat");
1658
+ }
1659
+ else if (pixel.vore < 0) {
1660
+ changePixel(pixel,"dead_plant");
1661
+ }
1662
+ else if (pixel.vore === 0) {
1663
+ changePixel(pixel,"sugar");
1664
+ }
1665
+ }
1666
+ else if (Math.random() > 0.5) {
1667
+ if (pixel.vore > 0) {
1668
+ changePixel(pixel,"meat");
1669
+ }
1670
+ else if (pixel.vore < 0) {
1671
+ changePixel(pixel,"grass");
1672
+ }
1673
+ else if (pixel.vore === 0) {
1674
+ changePixel(pixel,"sugar");
1675
+ }
1676
+ }
1677
+ }
1678
+ pixel.age += 1
1679
+ }
1680
+ else if (pixel.geneticCode > 70 && pixel.geneticCode < 81) {
1681
+ if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) {
1682
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
1683
+ }
1684
+ else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) {
1685
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
1686
+ }
1687
+ if (pixel.vore > -3 && pixel.vore < 3) {
1688
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) {
1689
+ deletePixel(pixel.x, pixel.y-1);
1690
+ pixel.food += 1
1691
+ }
1692
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && elements[pixelMap[pixel.x][pixel.y+1].element].isFood) {
1693
+ deletePixel(pixel.x, pixel.y+1);
1694
+ pixel.food += 1
1695
+ }
1696
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && elements[pixelMap[pixel.x+1][pixel.y].element].isFood) {
1697
+ deletePixel(pixel.x+1, pixel.y);
1698
+ pixel.food += 1
1699
+ }
1700
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && elements[pixelMap[pixel.x-1][pixel.y].element].isFood) {
1701
+ deletePixel(pixel.x-1, pixel.y);
1702
+ pixel.food += 1
1703
+ }
1704
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1705
+ deletePixel(pixel.x, pixel.y-1);
1706
+ pixel.food += 1
1707
+ }
1708
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1709
+ deletePixel(pixel.x, pixel.y+1);
1710
+ pixel.food += 1
1711
+ }
1712
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1713
+ deletePixel(pixel.x+1, pixel.y);
1714
+ pixel.food += 1
1715
+ }
1716
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1717
+ deletePixel(pixel.x-1, pixel.y);
1718
+ pixel.food += 1
1719
+ }
1720
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
1721
+ deletePixel(pixel.x, pixel.y-1);
1722
+ pixel.food += 1
1723
+ }
1724
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
1725
+ deletePixel(pixel.x, pixel.y+1);
1726
+ pixel.food += 1
1727
+ }
1728
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
1729
+ deletePixel(pixel.x+1, pixel.y);
1730
+ pixel.food += 1
1731
+ }
1732
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
1733
+ deletePixel(pixel.x-1, pixel.y);
1734
+ pixel.food += 1
1735
+ }
1736
+ }
1737
+ else if (pixel.vore > 2) {
1738
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
1739
+ deletePixel(pixel.x, pixel.y-1);
1740
+ pixel.food += 1
1741
+ }
1742
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
1743
+ deletePixel(pixel.x, pixel.y+1);
1744
+ pixel.food += 1
1745
+ }
1746
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
1747
+ deletePixel(pixel.x+1, pixel.y);
1748
+ pixel.food += 1
1749
+ }
1750
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
1751
+ deletePixel(pixel.x-1, pixel.y);
1752
+ pixel.food += 1
1753
+ }
1754
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
1755
+ deletePixel(pixel.x, pixel.y-1);
1756
+ pixel.food += 1
1757
+ }
1758
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
1759
+ deletePixel(pixel.x, pixel.y+1);
1760
+ pixel.food += 1
1761
+ }
1762
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
1763
+ deletePixel(pixel.x+1, pixel.y);
1764
+ pixel.food += 1
1765
+ }
1766
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
1767
+ deletePixel(pixel.x-1, pixel.y);
1768
+ pixel.food += 1
1769
+ }
1770
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") {
1771
+ deletePixel(pixel.x, pixel.y-1);
1772
+ pixel.food += 1
1773
+ }
1774
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") {
1775
+ deletePixel(pixel.x, pixel.y+1);
1776
+ pixel.food += 1
1777
+ }
1778
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") {
1779
+ deletePixel(pixel.x+1, pixel.y);
1780
+ pixel.food += 1
1781
+ }
1782
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") {
1783
+ deletePixel(pixel.x-1, pixel.y);
1784
+ pixel.food += 1
1785
+ }
1786
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") {
1787
+ deletePixel(pixel.x, pixel.y-1);
1788
+ pixel.food += 1
1789
+ }
1790
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") {
1791
+ deletePixel(pixel.x, pixel.y+1);
1792
+ pixel.food += 1
1793
+ }
1794
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") {
1795
+ deletePixel(pixel.x+1, pixel.y);
1796
+ pixel.food += 1
1797
+ }
1798
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") {
1799
+ deletePixel(pixel.x-1, pixel.y);
1800
+ pixel.food += 1
1801
+ }
1802
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") {
1803
+ deletePixel(pixel.x, pixel.y-1);
1804
+ pixel.food += 1
1805
+ }
1806
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") {
1807
+ deletePixel(pixel.x, pixel.y+1);
1808
+ pixel.food += 1
1809
+ }
1810
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") {
1811
+ deletePixel(pixel.x+1, pixel.y);
1812
+ pixel.food += 1
1813
+ }
1814
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") {
1815
+ deletePixel(pixel.x-1, pixel.y);
1816
+ pixel.food += 1
1817
+ }
1818
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") {
1819
+ deletePixel(pixel.x, pixel.y-1);
1820
+ pixel.food += 1
1821
+ }
1822
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") {
1823
+ deletePixel(pixel.x, pixel.y+1);
1824
+ pixel.food += 1
1825
+ }
1826
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") {
1827
+ deletePixel(pixel.x+1, pixel.y);
1828
+ pixel.food += 1
1829
+ }
1830
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") {
1831
+ deletePixel(pixel.x-1, pixel.y);
1832
+ pixel.food += 1
1833
+ }
1834
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") {
1835
+ deletePixel(pixel.x, pixel.y-1);
1836
+ pixel.food += 1
1837
+ }
1838
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") {
1839
+ deletePixel(pixel.x, pixel.y+1);
1840
+ pixel.food += 1
1841
+ }
1842
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") {
1843
+ deletePixel(pixel.x+1, pixel.y);
1844
+ pixel.food += 1
1845
+ }
1846
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") {
1847
+ deletePixel(pixel.x-1, pixel.y);
1848
+ pixel.food += 1
1849
+ }
1850
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") {
1851
+ deletePixel(pixel.x, pixel.y-1);
1852
+ pixel.food += 1
1853
+ }
1854
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") {
1855
+ deletePixel(pixel.x, pixel.y+1);
1856
+ pixel.food += 1
1857
+ }
1858
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") {
1859
+ deletePixel(pixel.x+1, pixel.y);
1860
+ pixel.food += 1
1861
+ }
1862
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") {
1863
+ deletePixel(pixel.x-1, pixel.y);
1864
+ pixel.food += 1
1865
+ }
1866
+ }
1867
+ else if (pixel.vore < -2) {
1868
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1869
+ deletePixel(pixel.x, pixel.y-1);
1870
+ pixel.food += 1
1871
+ }
1872
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1873
+ deletePixel(pixel.x, pixel.y+1);
1874
+ pixel.food += 1
1875
+ }
1876
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1877
+ deletePixel(pixel.x+1, pixel.y);
1878
+ pixel.food += 1
1879
+ }
1880
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1881
+ deletePixel(pixel.x-1, pixel.y);
1882
+ pixel.food += 1
1883
+ }
1884
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
1885
+ deletePixel(pixel.x, pixel.y-1);
1886
+ pixel.food += 1
1887
+ }
1888
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
1889
+ deletePixel(pixel.x, pixel.y+1);
1890
+ pixel.food += 1
1891
+ }
1892
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
1893
+ deletePixel(pixel.x+1, pixel.y);
1894
+ pixel.food += 1
1895
+ }
1896
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
1897
+ deletePixel(pixel.x-1, pixel.y);
1898
+ pixel.food += 1
1899
+ }
1900
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
1901
+ deletePixel(pixel.x, pixel.y-1);
1902
+ pixel.food += 1
1903
+ }
1904
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
1905
+ deletePixel(pixel.x, pixel.y+1);
1906
+ pixel.food += 1
1907
+ }
1908
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
1909
+ deletePixel(pixel.x+1, pixel.y);
1910
+ pixel.food += 1
1911
+ }
1912
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
1913
+ deletePixel(pixel.x-1, pixel.y);
1914
+ pixel.food += 1
1915
+ }
1916
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
1917
+ deletePixel(pixel.x, pixel.y-1);
1918
+ pixel.food += 1
1919
+ }
1920
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
1921
+ deletePixel(pixel.x, pixel.y+1);
1922
+ pixel.food += 1
1923
+ }
1924
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
1925
+ deletePixel(pixel.x+1, pixel.y);
1926
+ pixel.food += 1
1927
+ }
1928
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
1929
+ deletePixel(pixel.x-1, pixel.y);
1930
+ pixel.food += 1
1931
+ }
1932
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
1933
+ deletePixel(pixel.x, pixel.y-1);
1934
+ pixel.food += 1
1935
+ }
1936
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
1937
+ deletePixel(pixel.x, pixel.y+1);
1938
+ pixel.food += 1
1939
+ }
1940
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
1941
+ deletePixel(pixel.x+1, pixel.y);
1942
+ pixel.food += 1
1943
+ }
1944
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
1945
+ deletePixel(pixel.x-1, pixel.y);
1946
+ pixel.food += 1
1947
+ }
1948
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") {
1949
+ deletePixel(pixel.x, pixel.y-1);
1950
+ pixel.food += 1
1951
+ }
1952
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") {
1953
+ deletePixel(pixel.x, pixel.y+1);
1954
+ pixel.food += 1
1955
+ }
1956
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") {
1957
+ deletePixel(pixel.x+1, pixel.y);
1958
+ pixel.food += 1
1959
+ }
1960
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") {
1961
+ deletePixel(pixel.x-1, pixel.y);
1962
+ pixel.food += 1
1963
+ }
1964
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") {
1965
+ deletePixel(pixel.x, pixel.y-1);
1966
+ pixel.food += 1
1967
+ }
1968
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") {
1969
+ deletePixel(pixel.x, pixel.y+1);
1970
+ pixel.food += 1
1971
+ }
1972
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") {
1973
+ deletePixel(pixel.x+1, pixel.y);
1974
+ pixel.food += 1
1975
+ }
1976
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") {
1977
+ deletePixel(pixel.x-1, pixel.y);
1978
+ pixel.food += 1
1979
+ }
1980
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") {
1981
+ deletePixel(pixel.x, pixel.y-1);
1982
+ pixel.food += 1
1983
+ }
1984
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") {
1985
+ deletePixel(pixel.x, pixel.y+1);
1986
+ pixel.food += 1
1987
+ }
1988
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") {
1989
+ deletePixel(pixel.x+1, pixel.y);
1990
+ pixel.food += 1
1991
+ }
1992
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") {
1993
+ deletePixel(pixel.x-1, pixel.y);
1994
+ pixel.food += 1
1995
+ }
1996
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") {
1997
+ deletePixel(pixel.x, pixel.y-1);
1998
+ pixel.food += 1
1999
+ }
2000
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") {
2001
+ deletePixel(pixel.x, pixel.y+1);
2002
+ pixel.food += 1
2003
+ }
2004
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") {
2005
+ deletePixel(pixel.x+1, pixel.y);
2006
+ pixel.food += 1
2007
+ }
2008
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") {
2009
+ deletePixel(pixel.x-1, pixel.y);
2010
+ pixel.food += 1
2011
+ }
2012
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") {
2013
+ deletePixel(pixel.x, pixel.y-1);
2014
+ pixel.food += 1
2015
+ }
2016
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") {
2017
+ deletePixel(pixel.x, pixel.y+1);
2018
+ pixel.food += 1
2019
+ }
2020
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") {
2021
+ deletePixel(pixel.x+1, pixel.y);
2022
+ pixel.food += 1
2023
+ }
2024
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") {
2025
+ deletePixel(pixel.x-1, pixel.y);
2026
+ pixel.food += 1
2027
+ }
2028
+ }
2029
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
2030
+ createPixel("organism", pixel.x, pixel.y-1);
2031
+ pixel.food -= 5;
2032
+ if (Math.random() > 0.8) {
2033
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
2034
+ }
2035
+ if (Math.random() < 0.2) {
2036
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
2037
+ }
2038
+ else {
2039
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
2040
+ }
2041
+ if (Math.random() > 0.95) {
2042
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
2043
+ }
2044
+ if (Math.random() < 0.05) {
2045
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
2046
+ }
2047
+ else {
2048
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
2049
+ }
2050
+ }
2051
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
2052
+ createPixel("organism", pixel.x+1, pixel.y);
2053
+ pixel.food -= 5;
2054
+ if (Math.random() > 0.8) {
2055
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
2056
+ }
2057
+ if (Math.random() < 0.2) {
2058
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
2059
+ }
2060
+ else {
2061
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
2062
+ }
2063
+ if (Math.random() > 0.95) {
2064
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
2065
+ }
2066
+ if (Math.random() < 0.05) {
2067
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
2068
+ }
2069
+ else {
2070
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
2071
+ }
2072
+ }
2073
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
2074
+ createPixel("organism", pixel.x-1, pixel.y);
2075
+ pixel.food -= 5;
2076
+ if (Math.random() > 0.8) {
2077
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
2078
+ }
2079
+ if (Math.random() < 0.2) {
2080
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
2081
+ }
2082
+ else {
2083
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
2084
+ }
2085
+ if (Math.random() > 0.95) {
2086
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
2087
+ }
2088
+ if (Math.random() < 0.05) {
2089
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
2090
+ }
2091
+ else {
2092
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
2093
+ }
2094
+ }
2095
+ if (pixel.age > 10000 || pixel.dead === true) {
2096
+ if (Math.random() > 0.3) {
2097
+ if (pixel.vore > 0) {
2098
+ changePixel(pixel,"rotten_meat");
2099
+ }
2100
+ else if (pixel.vore < 0) {
2101
+ changePixel(pixel,"dead_plant");
2102
+ }
2103
+ else if (pixel.vore === 0) {
2104
+ changePixel(pixel,"sugar");
2105
+ }
2106
+ }
2107
+ else if (Math.random() > 0.5) {
2108
+ if (pixel.vore > 0) {
2109
+ changePixel(pixel,"meat");
2110
+ }
2111
+ else if (pixel.vore < 0) {
2112
+ changePixel(pixel,"grass");
2113
+ }
2114
+ else if (pixel.vore === 0) {
2115
+ changePixel(pixel,"sugar");
2116
+ }
2117
+ }
2118
+ }
2119
+ pixel.age += 1
2120
+ }
2121
+ else if (pixel.geneticCode > 80 && pixel.geneticCode < 91) {
2122
+ if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) {
2123
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
2124
+ }
2125
+ else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) {
2126
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
2127
+ }
2128
+ if (pixel.vore > -3 && pixel.vore < 3) {
2129
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) {
2130
+ deletePixel(pixel.x, pixel.y-1);
2131
+ pixel.food += 1
2132
+ }
2133
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && elements[pixelMap[pixel.x][pixel.y+1].element].isFood) {
2134
+ deletePixel(pixel.x, pixel.y+1);
2135
+ pixel.food += 1
2136
+ }
2137
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && elements[pixelMap[pixel.x+1][pixel.y].element].isFood) {
2138
+ deletePixel(pixel.x+1, pixel.y);
2139
+ pixel.food += 1
2140
+ }
2141
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && elements[pixelMap[pixel.x-1][pixel.y].element].isFood) {
2142
+ deletePixel(pixel.x-1, pixel.y);
2143
+ pixel.food += 1
2144
+ }
2145
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
2146
+ deletePixel(pixel.x, pixel.y-1);
2147
+ pixel.food += 1
2148
+ }
2149
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
2150
+ deletePixel(pixel.x, pixel.y+1);
2151
+ pixel.food += 1
2152
+ }
2153
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
2154
+ deletePixel(pixel.x+1, pixel.y);
2155
+ pixel.food += 1
2156
+ }
2157
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
2158
+ deletePixel(pixel.x-1, pixel.y);
2159
+ pixel.food += 1
2160
+ }
2161
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
2162
+ deletePixel(pixel.x, pixel.y-1);
2163
+ pixel.food += 1
2164
+ }
2165
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
2166
+ deletePixel(pixel.x, pixel.y+1);
2167
+ pixel.food += 1
2168
+ }
2169
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
2170
+ deletePixel(pixel.x+1, pixel.y);
2171
+ pixel.food += 1
2172
+ }
2173
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
2174
+ deletePixel(pixel.x-1, pixel.y);
2175
+ pixel.food += 1
2176
+ }
2177
+ }
2178
+ else if (pixel.vore > 2) {
2179
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
2180
+ deletePixel(pixel.x, pixel.y-1);
2181
+ pixel.food += 1
2182
+ }
2183
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
2184
+ deletePixel(pixel.x, pixel.y+1);
2185
+ pixel.food += 1
2186
+ }
2187
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
2188
+ deletePixel(pixel.x+1, pixel.y);
2189
+ pixel.food += 1
2190
+ }
2191
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
2192
+ deletePixel(pixel.x-1, pixel.y);
2193
+ pixel.food += 1
2194
+ }
2195
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
2196
+ deletePixel(pixel.x, pixel.y-1);
2197
+ pixel.food += 1
2198
+ }
2199
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
2200
+ deletePixel(pixel.x, pixel.y+1);
2201
+ pixel.food += 1
2202
+ }
2203
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
2204
+ deletePixel(pixel.x+1, pixel.y);
2205
+ pixel.food += 1
2206
+ }
2207
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
2208
+ deletePixel(pixel.x-1, pixel.y);
2209
+ pixel.food += 1
2210
+ }
2211
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") {
2212
+ deletePixel(pixel.x, pixel.y-1);
2213
+ pixel.food += 1
2214
+ }
2215
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") {
2216
+ deletePixel(pixel.x, pixel.y+1);
2217
+ pixel.food += 1
2218
+ }
2219
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") {
2220
+ deletePixel(pixel.x+1, pixel.y);
2221
+ pixel.food += 1
2222
+ }
2223
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") {
2224
+ deletePixel(pixel.x-1, pixel.y);
2225
+ pixel.food += 1
2226
+ }
2227
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") {
2228
+ deletePixel(pixel.x, pixel.y-1);
2229
+ pixel.food += 1
2230
+ }
2231
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") {
2232
+ deletePixel(pixel.x, pixel.y+1);
2233
+ pixel.food += 1
2234
+ }
2235
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") {
2236
+ deletePixel(pixel.x+1, pixel.y);
2237
+ pixel.food += 1
2238
+ }
2239
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") {
2240
+ deletePixel(pixel.x-1, pixel.y);
2241
+ pixel.food += 1
2242
+ }
2243
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") {
2244
+ deletePixel(pixel.x, pixel.y-1);
2245
+ pixel.food += 1
2246
+ }
2247
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") {
2248
+ deletePixel(pixel.x, pixel.y+1);
2249
+ pixel.food += 1
2250
+ }
2251
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") {
2252
+ deletePixel(pixel.x+1, pixel.y);
2253
+ pixel.food += 1
2254
+ }
2255
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") {
2256
+ deletePixel(pixel.x-1, pixel.y);
2257
+ pixel.food += 1
2258
+ }
2259
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") {
2260
+ deletePixel(pixel.x, pixel.y-1);
2261
+ pixel.food += 1
2262
+ }
2263
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") {
2264
+ deletePixel(pixel.x, pixel.y+1);
2265
+ pixel.food += 1
2266
+ }
2267
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") {
2268
+ deletePixel(pixel.x+1, pixel.y);
2269
+ pixel.food += 1
2270
+ }
2271
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") {
2272
+ deletePixel(pixel.x-1, pixel.y);
2273
+ pixel.food += 1
2274
+ }
2275
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") {
2276
+ deletePixel(pixel.x, pixel.y-1);
2277
+ pixel.food += 1
2278
+ }
2279
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") {
2280
+ deletePixel(pixel.x, pixel.y+1);
2281
+ pixel.food += 1
2282
+ }
2283
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") {
2284
+ deletePixel(pixel.x+1, pixel.y);
2285
+ pixel.food += 1
2286
+ }
2287
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") {
2288
+ deletePixel(pixel.x-1, pixel.y);
2289
+ pixel.food += 1
2290
+ }
2291
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") {
2292
+ deletePixel(pixel.x, pixel.y-1);
2293
+ pixel.food += 1
2294
+ }
2295
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") {
2296
+ deletePixel(pixel.x, pixel.y+1);
2297
+ pixel.food += 1
2298
+ }
2299
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") {
2300
+ deletePixel(pixel.x+1, pixel.y);
2301
+ pixel.food += 1
2302
+ }
2303
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") {
2304
+ deletePixel(pixel.x-1, pixel.y);
2305
+ pixel.food += 1
2306
+ }
2307
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") {
2308
+ deletePixel(pixel.x, pixel.y-1);
2309
+ pixel.food += 1
2310
+ }
2311
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "head") {
2312
+ deletePixel(pixel.x, pixel.y+1);
2313
+ pixel.food += 1
2314
+ }
2315
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "head") {
2316
+ deletePixel(pixel.x+1, pixel.y);
2317
+ pixel.food += 1
2318
+ }
2319
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "head") {
2320
+ deletePixel(pixel.x-1, pixel.y);
2321
+ pixel.food += 1
2322
+ }
2323
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "body") {
2324
+ deletePixel(pixel.x, pixel.y-1);
2325
+ pixel.food += 1
2326
+ }
2327
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "body") {
2328
+ deletePixel(pixel.x, pixel.y+1);
2329
+ pixel.food += 1
2330
+ }
2331
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "body") {
2332
+ deletePixel(pixel.x+1, pixel.y);
2333
+ pixel.food += 1
2334
+ }
2335
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "body") {
2336
+ deletePixel(pixel.x-1, pixel.y);
2337
+ pixel.food += 1
2338
+ }
2339
+ }
2340
+ else if (pixel.vore < -2) {
2341
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
2342
+ deletePixel(pixel.x, pixel.y-1);
2343
+ pixel.food += 1
2344
+ }
2345
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
2346
+ deletePixel(pixel.x, pixel.y+1);
2347
+ pixel.food += 1
2348
+ }
2349
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
2350
+ deletePixel(pixel.x+1, pixel.y);
2351
+ pixel.food += 1
2352
+ }
2353
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
2354
+ deletePixel(pixel.x-1, pixel.y);
2355
+ pixel.food += 1
2356
+ }
2357
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
2358
+ deletePixel(pixel.x, pixel.y-1);
2359
+ pixel.food += 1
2360
+ }
2361
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
2362
+ deletePixel(pixel.x, pixel.y+1);
2363
+ pixel.food += 1
2364
+ }
2365
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
2366
+ deletePixel(pixel.x+1, pixel.y);
2367
+ pixel.food += 1
2368
+ }
2369
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
2370
+ deletePixel(pixel.x-1, pixel.y);
2371
+ pixel.food += 1
2372
+ }
2373
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
2374
+ deletePixel(pixel.x, pixel.y-1);
2375
+ pixel.food += 1
2376
+ }
2377
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
2378
+ deletePixel(pixel.x, pixel.y+1);
2379
+ pixel.food += 1
2380
+ }
2381
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
2382
+ deletePixel(pixel.x+1, pixel.y);
2383
+ pixel.food += 1
2384
+ }
2385
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
2386
+ deletePixel(pixel.x-1, pixel.y);
2387
+ pixel.food += 1
2388
+ }
2389
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
2390
+ deletePixel(pixel.x, pixel.y-1);
2391
+ pixel.food += 1
2392
+ }
2393
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
2394
+ deletePixel(pixel.x, pixel.y+1);
2395
+ pixel.food += 1
2396
+ }
2397
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
2398
+ deletePixel(pixel.x+1, pixel.y);
2399
+ pixel.food += 1
2400
+ }
2401
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
2402
+ deletePixel(pixel.x-1, pixel.y);
2403
+ pixel.food += 1
2404
+ }
2405
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
2406
+ deletePixel(pixel.x, pixel.y-1);
2407
+ pixel.food += 1
2408
+ }
2409
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
2410
+ deletePixel(pixel.x, pixel.y+1);
2411
+ pixel.food += 1
2412
+ }
2413
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
2414
+ deletePixel(pixel.x+1, pixel.y);
2415
+ pixel.food += 1
2416
+ }
2417
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
2418
+ deletePixel(pixel.x-1, pixel.y);
2419
+ pixel.food += 1
2420
+ }
2421
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") {
2422
+ deletePixel(pixel.x, pixel.y-1);
2423
+ pixel.food += 1
2424
+ }
2425
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") {
2426
+ deletePixel(pixel.x, pixel.y+1);
2427
+ pixel.food += 1
2428
+ }
2429
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") {
2430
+ deletePixel(pixel.x+1, pixel.y);
2431
+ pixel.food += 1
2432
+ }
2433
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") {
2434
+ deletePixel(pixel.x-1, pixel.y);
2435
+ pixel.food += 1
2436
+ }
2437
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") {
2438
+ deletePixel(pixel.x, pixel.y-1);
2439
+ pixel.food += 1
2440
+ }
2441
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") {
2442
+ deletePixel(pixel.x, pixel.y+1);
2443
+ pixel.food += 1
2444
+ }
2445
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") {
2446
+ deletePixel(pixel.x+1, pixel.y);
2447
+ pixel.food += 1
2448
+ }
2449
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") {
2450
+ deletePixel(pixel.x-1, pixel.y);
2451
+ pixel.food += 1
2452
+ }
2453
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") {
2454
+ deletePixel(pixel.x, pixel.y-1);
2455
+ pixel.food += 1
2456
+ }
2457
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") {
2458
+ deletePixel(pixel.x, pixel.y+1);
2459
+ pixel.food += 1
2460
+ }
2461
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") {
2462
+ deletePixel(pixel.x+1, pixel.y);
2463
+ pixel.food += 1
2464
+ }
2465
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") {
2466
+ deletePixel(pixel.x-1, pixel.y);
2467
+ pixel.food += 1
2468
+ }
2469
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") {
2470
+ deletePixel(pixel.x, pixel.y-1);
2471
+ pixel.food += 1
2472
+ }
2473
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") {
2474
+ deletePixel(pixel.x, pixel.y+1);
2475
+ pixel.food += 1
2476
+ }
2477
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") {
2478
+ deletePixel(pixel.x+1, pixel.y);
2479
+ pixel.food += 1
2480
+ }
2481
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") {
2482
+ deletePixel(pixel.x-1, pixel.y);
2483
+ pixel.food += 1
2484
+ }
2485
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") {
2486
+ deletePixel(pixel.x, pixel.y-1);
2487
+ pixel.food += 1
2488
+ }
2489
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") {
2490
+ deletePixel(pixel.x, pixel.y+1);
2491
+ pixel.food += 1
2492
+ }
2493
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") {
2494
+ deletePixel(pixel.x+1, pixel.y);
2495
+ pixel.food += 1
2496
+ }
2497
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") {
2498
+ deletePixel(pixel.x-1, pixel.y);
2499
+ pixel.food += 1
2500
+ }
2501
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "petal") {
2502
+ deletePixel(pixel.x, pixel.y-1);
2503
+ pixel.food += 1
2504
+ }
2505
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "petal") {
2506
+ deletePixel(pixel.x, pixel.y+1);
2507
+ pixel.food += 1
2508
+ }
2509
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "petal") {
2510
+ deletePixel(pixel.x+1, pixel.y);
2511
+ pixel.food += 1
2512
+ }
2513
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "petal") {
2514
+ deletePixel(pixel.x-1, pixel.y);
2515
+ pixel.food += 1
2516
+ }
2517
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pistil") {
2518
+ deletePixel(pixel.x, pixel.y-1);
2519
+ pixel.food += 1
2520
+ }
2521
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pistil") {
2522
+ deletePixel(pixel.x, pixel.y+1);
2523
+ pixel.food += 1
2524
+ }
2525
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pistil") {
2526
+ deletePixel(pixel.x+1, pixel.y);
2527
+ pixel.food += 1
2528
+ }
2529
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pistil") {
2530
+ deletePixel(pixel.x-1, pixel.y);
2531
+ pixel.food += 1
2532
+ }
2533
+ }
2534
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
2535
+ createPixel("organism", pixel.x, pixel.y-1);
2536
+ pixel.food -= 5;
2537
+ if (Math.random() > 0.8) {
2538
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
2539
+ }
2540
+ if (Math.random() < 0.2) {
2541
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
2542
+ }
2543
+ else {
2544
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
2545
+ }
2546
+ if (Math.random() > 0.95) {
2547
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
2548
+ }
2549
+ if (Math.random() < 0.05) {
2550
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
2551
+ }
2552
+ else {
2553
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
2554
+ }
2555
+ }
2556
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
2557
+ createPixel("organism", pixel.x+1, pixel.y);
2558
+ pixel.food -= 5;
2559
+ if (Math.random() > 0.8) {
2560
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
2561
+ }
2562
+ if (Math.random() < 0.2) {
2563
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
2564
+ }
2565
+ else {
2566
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
2567
+ }
2568
+ if (Math.random() > 0.95) {
2569
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
2570
+ }
2571
+ if (Math.random() < 0.05) {
2572
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
2573
+ }
2574
+ else {
2575
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
2576
+ }
2577
+ }
2578
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
2579
+ createPixel("organism", pixel.x-1, pixel.y);
2580
+ pixel.food -= 5;
2581
+ if (Math.random() > 0.8) {
2582
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
2583
+ }
2584
+ if (Math.random() < 0.2) {
2585
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
2586
+ }
2587
+ else {
2588
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
2589
+ }
2590
+ if (Math.random() > 0.95) {
2591
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
2592
+ }
2593
+ if (Math.random() < 0.05) {
2594
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
2595
+ }
2596
+ else {
2597
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
2598
+ }
2599
+ }
2600
+ if (pixel.age > 10000 || pixel.dead === true) {
2601
+ if (Math.random() > 0.3) {
2602
+ if (pixel.vore > 0) {
2603
+ changePixel(pixel,"rotten_meat");
2604
+ }
2605
+ else if (pixel.vore < 0) {
2606
+ changePixel(pixel,"dead_plant");
2607
+ }
2608
+ else if (pixel.vore === 0) {
2609
+ changePixel(pixel,"sugar");
2610
+ }
2611
+ }
2612
+ else if (Math.random() > 0.5) {
2613
+ if (pixel.vore > 0) {
2614
+ changePixel(pixel,"meat");
2615
+ }
2616
+ else if (pixel.vore < 0) {
2617
+ changePixel(pixel,"grass");
2618
+ }
2619
+ else if (pixel.vore === 0) {
2620
+ changePixel(pixel,"sugar");
2621
+ }
2622
+ }
2623
+ }
2624
+ pixel.age += 1
2625
+ }
2626
+ else if (pixel.geneticCode > 90 && pixel.geneticCode < 101) {
2627
+ if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) {
2628
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
2629
+ }
2630
+ else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) {
2631
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
2632
+ }
2633
+ if (pixel.vore > -3 && pixel.vore < 3) {
2634
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) {
2635
+ deletePixel(pixel.x, pixel.y-1);
2636
+ pixel.food += 1
2637
+ }
2638
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && elements[pixelMap[pixel.x][pixel.y+1].element].isFood) {
2639
+ deletePixel(pixel.x, pixel.y+1);
2640
+ pixel.food += 1
2641
+ }
2642
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && elements[pixelMap[pixel.x+1][pixel.y].element].isFood) {
2643
+ deletePixel(pixel.x+1, pixel.y);
2644
+ pixel.food += 1
2645
+ }
2646
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && elements[pixelMap[pixel.x-1][pixel.y].element].isFood) {
2647
+ deletePixel(pixel.x-1, pixel.y);
2648
+ pixel.food += 1
2649
+ }
2650
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
2651
+ deletePixel(pixel.x, pixel.y-1);
2652
+ pixel.food += 1
2653
+ }
2654
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
2655
+ deletePixel(pixel.x, pixel.y+1);
2656
+ pixel.food += 1
2657
+ }
2658
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
2659
+ deletePixel(pixel.x+1, pixel.y);
2660
+ pixel.food += 1
2661
+ }
2662
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
2663
+ deletePixel(pixel.x-1, pixel.y);
2664
+ pixel.food += 1
2665
+ }
2666
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
2667
+ deletePixel(pixel.x, pixel.y-1);
2668
+ pixel.food += 1
2669
+ }
2670
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
2671
+ deletePixel(pixel.x, pixel.y+1);
2672
+ pixel.food += 1
2673
+ }
2674
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
2675
+ deletePixel(pixel.x+1, pixel.y);
2676
+ pixel.food += 1
2677
+ }
2678
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
2679
+ deletePixel(pixel.x-1, pixel.y);
2680
+ pixel.food += 1
2681
+ }
2682
+ }
2683
+ else if (pixel.vore > 2) {
2684
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
2685
+ deletePixel(pixel.x, pixel.y-1);
2686
+ pixel.food += 1
2687
+ }
2688
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
2689
+ deletePixel(pixel.x, pixel.y+1);
2690
+ pixel.food += 1
2691
+ }
2692
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
2693
+ deletePixel(pixel.x+1, pixel.y);
2694
+ pixel.food += 1
2695
+ }
2696
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
2697
+ deletePixel(pixel.x-1, pixel.y);
2698
+ pixel.food += 1
2699
+ }
2700
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
2701
+ deletePixel(pixel.x, pixel.y-1);
2702
+ pixel.food += 1
2703
+ }
2704
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
2705
+ deletePixel(pixel.x, pixel.y+1);
2706
+ pixel.food += 1
2707
+ }
2708
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
2709
+ deletePixel(pixel.x+1, pixel.y);
2710
+ pixel.food += 1
2711
+ }
2712
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
2713
+ deletePixel(pixel.x-1, pixel.y);
2714
+ pixel.food += 1
2715
+ }
2716
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") {
2717
+ deletePixel(pixel.x, pixel.y-1);
2718
+ pixel.food += 1
2719
+ }
2720
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") {
2721
+ deletePixel(pixel.x, pixel.y+1);
2722
+ pixel.food += 1
2723
+ }
2724
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") {
2725
+ deletePixel(pixel.x+1, pixel.y);
2726
+ pixel.food += 1
2727
+ }
2728
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") {
2729
+ deletePixel(pixel.x-1, pixel.y);
2730
+ pixel.food += 1
2731
+ }
2732
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") {
2733
+ deletePixel(pixel.x, pixel.y-1);
2734
+ pixel.food += 1
2735
+ }
2736
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") {
2737
+ deletePixel(pixel.x, pixel.y+1);
2738
+ pixel.food += 1
2739
+ }
2740
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") {
2741
+ deletePixel(pixel.x+1, pixel.y);
2742
+ pixel.food += 1
2743
+ }
2744
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") {
2745
+ deletePixel(pixel.x-1, pixel.y);
2746
+ pixel.food += 1
2747
+ }
2748
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") {
2749
+ deletePixel(pixel.x, pixel.y-1);
2750
+ pixel.food += 1
2751
+ }
2752
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") {
2753
+ deletePixel(pixel.x, pixel.y+1);
2754
+ pixel.food += 1
2755
+ }
2756
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") {
2757
+ deletePixel(pixel.x+1, pixel.y);
2758
+ pixel.food += 1
2759
+ }
2760
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") {
2761
+ deletePixel(pixel.x-1, pixel.y);
2762
+ pixel.food += 1
2763
+ }
2764
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") {
2765
+ deletePixel(pixel.x, pixel.y-1);
2766
+ pixel.food += 1
2767
+ }
2768
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") {
2769
+ deletePixel(pixel.x, pixel.y+1);
2770
+ pixel.food += 1
2771
+ }
2772
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") {
2773
+ deletePixel(pixel.x+1, pixel.y);
2774
+ pixel.food += 1
2775
+ }
2776
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") {
2777
+ deletePixel(pixel.x-1, pixel.y);
2778
+ pixel.food += 1
2779
+ }
2780
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") {
2781
+ deletePixel(pixel.x, pixel.y-1);
2782
+ pixel.food += 1
2783
+ }
2784
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") {
2785
+ deletePixel(pixel.x, pixel.y+1);
2786
+ pixel.food += 1
2787
+ }
2788
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") {
2789
+ deletePixel(pixel.x+1, pixel.y);
2790
+ pixel.food += 1
2791
+ }
2792
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") {
2793
+ deletePixel(pixel.x-1, pixel.y);
2794
+ pixel.food += 1
2795
+ }
2796
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") {
2797
+ deletePixel(pixel.x, pixel.y-1);
2798
+ pixel.food += 1
2799
+ }
2800
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") {
2801
+ deletePixel(pixel.x, pixel.y+1);
2802
+ pixel.food += 1
2803
+ }
2804
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") {
2805
+ deletePixel(pixel.x+1, pixel.y);
2806
+ pixel.food += 1
2807
+ }
2808
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") {
2809
+ deletePixel(pixel.x-1, pixel.y);
2810
+ pixel.food += 1
2811
+ }
2812
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") {
2813
+ deletePixel(pixel.x, pixel.y-1);
2814
+ pixel.food += 1
2815
+ }
2816
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "head") {
2817
+ deletePixel(pixel.x, pixel.y+1);
2818
+ pixel.food += 1
2819
+ }
2820
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "head") {
2821
+ deletePixel(pixel.x+1, pixel.y);
2822
+ pixel.food += 1
2823
+ }
2824
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "head") {
2825
+ deletePixel(pixel.x-1, pixel.y);
2826
+ pixel.food += 1
2827
+ }
2828
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "body") {
2829
+ deletePixel(pixel.x, pixel.y-1);
2830
+ pixel.food += 1
2831
+ }
2832
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "body") {
2833
+ deletePixel(pixel.x, pixel.y+1);
2834
+ pixel.food += 1
2835
+ }
2836
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "body") {
2837
+ deletePixel(pixel.x+1, pixel.y);
2838
+ pixel.food += 1
2839
+ }
2840
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "body") {
2841
+ deletePixel(pixel.x-1, pixel.y);
2842
+ pixel.food += 1
2843
+ }
2844
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bone") {
2845
+ deletePixel(pixel.x, pixel.y-1);
2846
+ pixel.food += 1
2847
+ }
2848
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bone") {
2849
+ deletePixel(pixel.x, pixel.y+1);
2850
+ pixel.food += 1
2851
+ }
2852
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bone") {
2853
+ deletePixel(pixel.x+1, pixel.y);
2854
+ pixel.food += 1
2855
+ }
2856
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bone") {
2857
+ deletePixel(pixel.x-1, pixel.y);
2858
+ pixel.food += 1
2859
+ }
2860
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "blood") {
2861
+ deletePixel(pixel.x, pixel.y-1);
2862
+ pixel.food += 1
2863
+ }
2864
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "blood") {
2865
+ deletePixel(pixel.x, pixel.y+1);
2866
+ pixel.food += 1
2867
+ }
2868
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "blood") {
2869
+ deletePixel(pixel.x+1, pixel.y);
2870
+ pixel.food += 1
2871
+ }
2872
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "blood") {
2873
+ deletePixel(pixel.x-1, pixel.y);
2874
+ pixel.food += 1
2875
+ }
2876
+ }
2877
+ else if (pixel.vore < -2) {
2878
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
2879
+ deletePixel(pixel.x, pixel.y-1);
2880
+ pixel.food += 1
2881
+ }
2882
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
2883
+ deletePixel(pixel.x, pixel.y+1);
2884
+ pixel.food += 1
2885
+ }
2886
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
2887
+ deletePixel(pixel.x+1, pixel.y);
2888
+ pixel.food += 1
2889
+ }
2890
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
2891
+ deletePixel(pixel.x-1, pixel.y);
2892
+ pixel.food += 1
2893
+ }
2894
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
2895
+ deletePixel(pixel.x, pixel.y-1);
2896
+ pixel.food += 1
2897
+ }
2898
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
2899
+ deletePixel(pixel.x, pixel.y+1);
2900
+ pixel.food += 1
2901
+ }
2902
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
2903
+ deletePixel(pixel.x+1, pixel.y);
2904
+ pixel.food += 1
2905
+ }
2906
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
2907
+ deletePixel(pixel.x-1, pixel.y);
2908
+ pixel.food += 1
2909
+ }
2910
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
2911
+ deletePixel(pixel.x, pixel.y-1);
2912
+ pixel.food += 1
2913
+ }
2914
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
2915
+ deletePixel(pixel.x, pixel.y+1);
2916
+ pixel.food += 1
2917
+ }
2918
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
2919
+ deletePixel(pixel.x+1, pixel.y);
2920
+ pixel.food += 1
2921
+ }
2922
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
2923
+ deletePixel(pixel.x-1, pixel.y);
2924
+ pixel.food += 1
2925
+ }
2926
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
2927
+ deletePixel(pixel.x, pixel.y-1);
2928
+ pixel.food += 1
2929
+ }
2930
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
2931
+ deletePixel(pixel.x, pixel.y+1);
2932
+ pixel.food += 1
2933
+ }
2934
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
2935
+ deletePixel(pixel.x+1, pixel.y);
2936
+ pixel.food += 1
2937
+ }
2938
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
2939
+ deletePixel(pixel.x-1, pixel.y);
2940
+ pixel.food += 1
2941
+ }
2942
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
2943
+ deletePixel(pixel.x, pixel.y-1);
2944
+ pixel.food += 1
2945
+ }
2946
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
2947
+ deletePixel(pixel.x, pixel.y+1);
2948
+ pixel.food += 1
2949
+ }
2950
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
2951
+ deletePixel(pixel.x+1, pixel.y);
2952
+ pixel.food += 1
2953
+ }
2954
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
2955
+ deletePixel(pixel.x-1, pixel.y);
2956
+ pixel.food += 1
2957
+ }
2958
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") {
2959
+ deletePixel(pixel.x, pixel.y-1);
2960
+ pixel.food += 1
2961
+ }
2962
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") {
2963
+ deletePixel(pixel.x, pixel.y+1);
2964
+ pixel.food += 1
2965
+ }
2966
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") {
2967
+ deletePixel(pixel.x+1, pixel.y);
2968
+ pixel.food += 1
2969
+ }
2970
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") {
2971
+ deletePixel(pixel.x-1, pixel.y);
2972
+ pixel.food += 1
2973
+ }
2974
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") {
2975
+ deletePixel(pixel.x, pixel.y-1);
2976
+ pixel.food += 1
2977
+ }
2978
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") {
2979
+ deletePixel(pixel.x, pixel.y+1);
2980
+ pixel.food += 1
2981
+ }
2982
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") {
2983
+ deletePixel(pixel.x+1, pixel.y);
2984
+ pixel.food += 1
2985
+ }
2986
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") {
2987
+ deletePixel(pixel.x-1, pixel.y);
2988
+ pixel.food += 1
2989
+ }
2990
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") {
2991
+ deletePixel(pixel.x, pixel.y-1);
2992
+ pixel.food += 1
2993
+ }
2994
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") {
2995
+ deletePixel(pixel.x, pixel.y+1);
2996
+ pixel.food += 1
2997
+ }
2998
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") {
2999
+ deletePixel(pixel.x+1, pixel.y);
3000
+ pixel.food += 1
3001
+ }
3002
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") {
3003
+ deletePixel(pixel.x-1, pixel.y);
3004
+ pixel.food += 1
3005
+ }
3006
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") {
3007
+ deletePixel(pixel.x, pixel.y-1);
3008
+ pixel.food += 1
3009
+ }
3010
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") {
3011
+ deletePixel(pixel.x, pixel.y+1);
3012
+ pixel.food += 1
3013
+ }
3014
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") {
3015
+ deletePixel(pixel.x+1, pixel.y);
3016
+ pixel.food += 1
3017
+ }
3018
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") {
3019
+ deletePixel(pixel.x-1, pixel.y);
3020
+ pixel.food += 1
3021
+ }
3022
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") {
3023
+ deletePixel(pixel.x, pixel.y-1);
3024
+ pixel.food += 1
3025
+ }
3026
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") {
3027
+ deletePixel(pixel.x, pixel.y+1);
3028
+ pixel.food += 1
3029
+ }
3030
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") {
3031
+ deletePixel(pixel.x+1, pixel.y);
3032
+ pixel.food += 1
3033
+ }
3034
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") {
3035
+ deletePixel(pixel.x-1, pixel.y);
3036
+ pixel.food += 1
3037
+ }
3038
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "petal") {
3039
+ deletePixel(pixel.x, pixel.y-1);
3040
+ pixel.food += 1
3041
+ }
3042
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "petal") {
3043
+ deletePixel(pixel.x, pixel.y+1);
3044
+ pixel.food += 1
3045
+ }
3046
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "petal") {
3047
+ deletePixel(pixel.x+1, pixel.y);
3048
+ pixel.food += 1
3049
+ }
3050
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "petal") {
3051
+ deletePixel(pixel.x-1, pixel.y);
3052
+ pixel.food += 1
3053
+ }
3054
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pistil") {
3055
+ deletePixel(pixel.x, pixel.y-1);
3056
+ pixel.food += 1
3057
+ }
3058
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pistil") {
3059
+ deletePixel(pixel.x, pixel.y+1);
3060
+ pixel.food += 1
3061
+ }
3062
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pistil") {
3063
+ deletePixel(pixel.x+1, pixel.y);
3064
+ pixel.food += 1
3065
+ }
3066
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pistil") {
3067
+ deletePixel(pixel.x-1, pixel.y);
3068
+ pixel.food += 1
3069
+ }
3070
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sapling") {
3071
+ deletePixel(pixel.x, pixel.y-1);
3072
+ pixel.food += 1
3073
+ }
3074
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sapling") {
3075
+ deletePixel(pixel.x, pixel.y+1);
3076
+ pixel.food += 1
3077
+ }
3078
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sapling") {
3079
+ deletePixel(pixel.x+1, pixel.y);
3080
+ pixel.food += 1
3081
+ }
3082
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sapling") {
3083
+ deletePixel(pixel.x-1, pixel.y);
3084
+ pixel.food += 1
3085
+ }
3086
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pinecone") {
3087
+ deletePixel(pixel.x, pixel.y-1);
3088
+ pixel.food += 1
3089
+ }
3090
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pinecone") {
3091
+ deletePixel(pixel.x, pixel.y+1);
3092
+ pixel.food += 1
3093
+ }
3094
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pinecone") {
3095
+ deletePixel(pixel.x+1, pixel.y);
3096
+ pixel.food += 1
3097
+ }
3098
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pinecone") {
3099
+ deletePixel(pixel.x-1, pixel.y);
3100
+ pixel.food += 1
3101
+ }
3102
+ }
3103
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
3104
+ createPixel("organism", pixel.x, pixel.y-1);
3105
+ pixel.food -= 5;
3106
+ if (Math.random() > 0.8) {
3107
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
3108
+ }
3109
+ if (Math.random() < 0.2) {
3110
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
3111
+ }
3112
+ else {
3113
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
3114
+ }
3115
+ if (Math.random() > 0.995) {
3116
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
3117
+ }
3118
+ if (Math.random() < 0.005) {
3119
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
3120
+ }
3121
+ else {
3122
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
3123
+ }
3124
+ }
3125
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
3126
+ createPixel("organism", pixel.x+1, pixel.y);
3127
+ pixel.food -= 5;
3128
+ if (Math.random() > 0.8) {
3129
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
3130
+ }
3131
+ if (Math.random() < 0.2) {
3132
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
3133
+ }
3134
+ else {
3135
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
3136
+ }
3137
+ if (Math.random() > 0.995) {
3138
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
3139
+ }
3140
+ if (Math.random() < 0.005) {
3141
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
3142
+ }
3143
+ else {
3144
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
3145
+ }
3146
+ }
3147
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
3148
+ createPixel("organism", pixel.x-1, pixel.y);
3149
+ pixel.food -= 5;
3150
+ if (Math.random() > 0.8) {
3151
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
3152
+ }
3153
+ if (Math.random() < 0.2) {
3154
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
3155
+ }
3156
+ else {
3157
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
3158
+ }
3159
+ if (Math.random() > 0.995) {
3160
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
3161
+ }
3162
+ if (Math.random() < 0.005) {
3163
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
3164
+ }
3165
+ else {
3166
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
3167
+ }
3168
+ }
3169
+ if (pixel.age > 10000 || pixel.dead === true) {
3170
+ if (Math.random() > 0.3) {
3171
+ if (pixel.vore > 0) {
3172
+ changePixel(pixel,"rotten_meat");
3173
+ }
3174
+ else if (pixel.vore < 0) {
3175
+ changePixel(pixel,"dead_plant");
3176
+ }
3177
+ else if (pixel.vore === 0) {
3178
+ changePixel(pixel,"sugar");
3179
+ }
3180
+ }
3181
+ else if (Math.random() > 0.5) {
3182
+ if (pixel.vore > 0) {
3183
+ changePixel(pixel,"meat");
3184
+ }
3185
+ else if (pixel.vore < 0) {
3186
+ changePixel(pixel,"grass");
3187
+ }
3188
+ else if (pixel.vore === 0) {
3189
+ changePixel(pixel,"sugar");
3190
+ }
3191
+ }
3192
+ }
3193
+ pixel.age += 1
3194
+ }
3195
+ else if (pixel.geneticCode > 100) {
3196
+ if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) {
3197
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y);
3198
+ }
3199
+ else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) {
3200
+ movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y);
3201
+ }
3202
+ if (pixel.vore > -3 && pixel.vore < 3) {
3203
+ changePixel(pixel,"human");
3204
+ }
3205
+ else if (pixel.vore > 2) {
3206
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") {
3207
+ deletePixel(pixel.x, pixel.y-1);
3208
+ pixel.food += 1
3209
+ }
3210
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") {
3211
+ deletePixel(pixel.x, pixel.y+1);
3212
+ pixel.food += 1
3213
+ }
3214
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") {
3215
+ deletePixel(pixel.x+1, pixel.y);
3216
+ pixel.food += 1
3217
+ }
3218
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") {
3219
+ deletePixel(pixel.x-1, pixel.y);
3220
+ pixel.food += 1
3221
+ }
3222
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") {
3223
+ deletePixel(pixel.x, pixel.y-1);
3224
+ pixel.food += 1
3225
+ }
3226
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") {
3227
+ deletePixel(pixel.x, pixel.y+1);
3228
+ pixel.food += 1
3229
+ }
3230
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") {
3231
+ deletePixel(pixel.x+1, pixel.y);
3232
+ pixel.food += 1
3233
+ }
3234
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") {
3235
+ deletePixel(pixel.x-1, pixel.y);
3236
+ pixel.food += 1
3237
+ }
3238
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") {
3239
+ deletePixel(pixel.x, pixel.y-1);
3240
+ pixel.food += 1
3241
+ }
3242
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") {
3243
+ deletePixel(pixel.x, pixel.y+1);
3244
+ pixel.food += 1
3245
+ }
3246
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") {
3247
+ deletePixel(pixel.x+1, pixel.y);
3248
+ pixel.food += 1
3249
+ }
3250
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") {
3251
+ deletePixel(pixel.x-1, pixel.y);
3252
+ pixel.food += 1
3253
+ }
3254
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") {
3255
+ deletePixel(pixel.x, pixel.y-1);
3256
+ pixel.food += 1
3257
+ }
3258
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") {
3259
+ deletePixel(pixel.x, pixel.y+1);
3260
+ pixel.food += 1
3261
+ }
3262
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") {
3263
+ deletePixel(pixel.x+1, pixel.y);
3264
+ pixel.food += 1
3265
+ }
3266
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") {
3267
+ deletePixel(pixel.x-1, pixel.y);
3268
+ pixel.food += 1
3269
+ }
3270
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") {
3271
+ deletePixel(pixel.x, pixel.y-1);
3272
+ pixel.food += 1
3273
+ }
3274
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") {
3275
+ deletePixel(pixel.x, pixel.y+1);
3276
+ pixel.food += 1
3277
+ }
3278
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") {
3279
+ deletePixel(pixel.x+1, pixel.y);
3280
+ pixel.food += 1
3281
+ }
3282
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") {
3283
+ deletePixel(pixel.x-1, pixel.y);
3284
+ pixel.food += 1
3285
+ }
3286
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") {
3287
+ deletePixel(pixel.x, pixel.y-1);
3288
+ pixel.food += 1
3289
+ }
3290
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") {
3291
+ deletePixel(pixel.x, pixel.y+1);
3292
+ pixel.food += 1
3293
+ }
3294
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") {
3295
+ deletePixel(pixel.x+1, pixel.y);
3296
+ pixel.food += 1
3297
+ }
3298
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") {
3299
+ deletePixel(pixel.x-1, pixel.y);
3300
+ pixel.food += 1
3301
+ }
3302
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") {
3303
+ deletePixel(pixel.x, pixel.y-1);
3304
+ pixel.food += 1
3305
+ }
3306
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") {
3307
+ deletePixel(pixel.x, pixel.y+1);
3308
+ pixel.food += 1
3309
+ }
3310
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") {
3311
+ deletePixel(pixel.x+1, pixel.y);
3312
+ pixel.food += 1
3313
+ }
3314
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") {
3315
+ deletePixel(pixel.x-1, pixel.y);
3316
+ pixel.food += 1
3317
+ }
3318
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") {
3319
+ deletePixel(pixel.x, pixel.y-1);
3320
+ pixel.food += 1
3321
+ }
3322
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") {
3323
+ deletePixel(pixel.x, pixel.y+1);
3324
+ pixel.food += 1
3325
+ }
3326
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") {
3327
+ deletePixel(pixel.x+1, pixel.y);
3328
+ pixel.food += 1
3329
+ }
3330
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") {
3331
+ deletePixel(pixel.x-1, pixel.y);
3332
+ pixel.food += 1
3333
+ }
3334
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") {
3335
+ deletePixel(pixel.x, pixel.y-1);
3336
+ pixel.food += 1
3337
+ }
3338
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "head") {
3339
+ deletePixel(pixel.x, pixel.y+1);
3340
+ pixel.food += 1
3341
+ }
3342
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "head") {
3343
+ deletePixel(pixel.x+1, pixel.y);
3344
+ pixel.food += 1
3345
+ }
3346
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "head") {
3347
+ deletePixel(pixel.x-1, pixel.y);
3348
+ pixel.food += 1
3349
+ }
3350
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "body") {
3351
+ deletePixel(pixel.x, pixel.y-1);
3352
+ pixel.food += 1
3353
+ }
3354
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "body") {
3355
+ deletePixel(pixel.x, pixel.y+1);
3356
+ pixel.food += 1
3357
+ }
3358
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "body") {
3359
+ deletePixel(pixel.x+1, pixel.y);
3360
+ pixel.food += 1
3361
+ }
3362
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "body") {
3363
+ deletePixel(pixel.x-1, pixel.y);
3364
+ pixel.food += 1
3365
+ }
3366
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bone") {
3367
+ deletePixel(pixel.x, pixel.y-1);
3368
+ pixel.food += 1
3369
+ }
3370
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bone") {
3371
+ deletePixel(pixel.x, pixel.y+1);
3372
+ pixel.food += 1
3373
+ }
3374
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bone") {
3375
+ deletePixel(pixel.x+1, pixel.y);
3376
+ pixel.food += 1
3377
+ }
3378
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bone") {
3379
+ deletePixel(pixel.x-1, pixel.y);
3380
+ pixel.food += 1
3381
+ }
3382
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "blood") {
3383
+ deletePixel(pixel.x, pixel.y-1);
3384
+ pixel.food += 1
3385
+ }
3386
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "blood") {
3387
+ deletePixel(pixel.x, pixel.y+1);
3388
+ pixel.food += 1
3389
+ }
3390
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "blood") {
3391
+ deletePixel(pixel.x+1, pixel.y);
3392
+ pixel.food += 1
3393
+ }
3394
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "blood") {
3395
+ deletePixel(pixel.x-1, pixel.y);
3396
+ pixel.food += 1
3397
+ }
3398
+ }
3399
+ else if (pixel.vore < -2) {
3400
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
3401
+ deletePixel(pixel.x, pixel.y-1);
3402
+ pixel.food += 1
3403
+ }
3404
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
3405
+ deletePixel(pixel.x, pixel.y+1);
3406
+ pixel.food += 1
3407
+ }
3408
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
3409
+ deletePixel(pixel.x+1, pixel.y);
3410
+ pixel.food += 1
3411
+ }
3412
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
3413
+ deletePixel(pixel.x-1, pixel.y);
3414
+ pixel.food += 1
3415
+ }
3416
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") {
3417
+ deletePixel(pixel.x, pixel.y-1);
3418
+ pixel.food += 1
3419
+ }
3420
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") {
3421
+ deletePixel(pixel.x, pixel.y+1);
3422
+ pixel.food += 1
3423
+ }
3424
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") {
3425
+ deletePixel(pixel.x+1, pixel.y);
3426
+ pixel.food += 1
3427
+ }
3428
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") {
3429
+ deletePixel(pixel.x-1, pixel.y);
3430
+ pixel.food += 1
3431
+ }
3432
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") {
3433
+ deletePixel(pixel.x, pixel.y-1);
3434
+ pixel.food += 1
3435
+ }
3436
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") {
3437
+ deletePixel(pixel.x, pixel.y+1);
3438
+ pixel.food += 1
3439
+ }
3440
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") {
3441
+ deletePixel(pixel.x+1, pixel.y);
3442
+ pixel.food += 1
3443
+ }
3444
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") {
3445
+ deletePixel(pixel.x-1, pixel.y);
3446
+ pixel.food += 1
3447
+ }
3448
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
3449
+ deletePixel(pixel.x, pixel.y-1);
3450
+ pixel.food += 1
3451
+ }
3452
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
3453
+ deletePixel(pixel.x, pixel.y+1);
3454
+ pixel.food += 1
3455
+ }
3456
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
3457
+ deletePixel(pixel.x+1, pixel.y);
3458
+ pixel.food += 1
3459
+ }
3460
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
3461
+ deletePixel(pixel.x-1, pixel.y);
3462
+ pixel.food += 1
3463
+ }
3464
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") {
3465
+ deletePixel(pixel.x, pixel.y-1);
3466
+ pixel.food += 1
3467
+ }
3468
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") {
3469
+ deletePixel(pixel.x, pixel.y+1);
3470
+ pixel.food += 1
3471
+ }
3472
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") {
3473
+ deletePixel(pixel.x+1, pixel.y);
3474
+ pixel.food += 1
3475
+ }
3476
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") {
3477
+ deletePixel(pixel.x-1, pixel.y);
3478
+ pixel.food += 1
3479
+ }
3480
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") {
3481
+ deletePixel(pixel.x, pixel.y-1);
3482
+ pixel.food += 1
3483
+ }
3484
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") {
3485
+ deletePixel(pixel.x, pixel.y+1);
3486
+ pixel.food += 1
3487
+ }
3488
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") {
3489
+ deletePixel(pixel.x+1, pixel.y);
3490
+ pixel.food += 1
3491
+ }
3492
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") {
3493
+ deletePixel(pixel.x-1, pixel.y);
3494
+ pixel.food += 1
3495
+ }
3496
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") {
3497
+ deletePixel(pixel.x, pixel.y-1);
3498
+ pixel.food += 1
3499
+ }
3500
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") {
3501
+ deletePixel(pixel.x, pixel.y+1);
3502
+ pixel.food += 1
3503
+ }
3504
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") {
3505
+ deletePixel(pixel.x+1, pixel.y);
3506
+ pixel.food += 1
3507
+ }
3508
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") {
3509
+ deletePixel(pixel.x-1, pixel.y);
3510
+ pixel.food += 1
3511
+ }
3512
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") {
3513
+ deletePixel(pixel.x, pixel.y-1);
3514
+ pixel.food += 1
3515
+ }
3516
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") {
3517
+ deletePixel(pixel.x, pixel.y+1);
3518
+ pixel.food += 1
3519
+ }
3520
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") {
3521
+ deletePixel(pixel.x+1, pixel.y);
3522
+ pixel.food += 1
3523
+ }
3524
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") {
3525
+ deletePixel(pixel.x-1, pixel.y);
3526
+ pixel.food += 1
3527
+ }
3528
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") {
3529
+ deletePixel(pixel.x, pixel.y-1);
3530
+ pixel.food += 1
3531
+ }
3532
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") {
3533
+ deletePixel(pixel.x, pixel.y+1);
3534
+ pixel.food += 1
3535
+ }
3536
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") {
3537
+ deletePixel(pixel.x+1, pixel.y);
3538
+ pixel.food += 1
3539
+ }
3540
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") {
3541
+ deletePixel(pixel.x-1, pixel.y);
3542
+ pixel.food += 1
3543
+ }
3544
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") {
3545
+ deletePixel(pixel.x, pixel.y-1);
3546
+ pixel.food += 1
3547
+ }
3548
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") {
3549
+ deletePixel(pixel.x, pixel.y+1);
3550
+ pixel.food += 1
3551
+ }
3552
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") {
3553
+ deletePixel(pixel.x+1, pixel.y);
3554
+ pixel.food += 1
3555
+ }
3556
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") {
3557
+ deletePixel(pixel.x-1, pixel.y);
3558
+ pixel.food += 1
3559
+ }
3560
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "petal") {
3561
+ deletePixel(pixel.x, pixel.y-1);
3562
+ pixel.food += 1
3563
+ }
3564
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "petal") {
3565
+ deletePixel(pixel.x, pixel.y+1);
3566
+ pixel.food += 1
3567
+ }
3568
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "petal") {
3569
+ deletePixel(pixel.x+1, pixel.y);
3570
+ pixel.food += 1
3571
+ }
3572
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "petal") {
3573
+ deletePixel(pixel.x-1, pixel.y);
3574
+ pixel.food += 1
3575
+ }
3576
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pistil") {
3577
+ deletePixel(pixel.x, pixel.y-1);
3578
+ pixel.food += 1
3579
+ }
3580
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pistil") {
3581
+ deletePixel(pixel.x, pixel.y+1);
3582
+ pixel.food += 1
3583
+ }
3584
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pistil") {
3585
+ deletePixel(pixel.x+1, pixel.y);
3586
+ pixel.food += 1
3587
+ }
3588
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pistil") {
3589
+ deletePixel(pixel.x-1, pixel.y);
3590
+ pixel.food += 1
3591
+ }
3592
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sapling") {
3593
+ deletePixel(pixel.x, pixel.y-1);
3594
+ pixel.food += 1
3595
+ }
3596
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sapling") {
3597
+ deletePixel(pixel.x, pixel.y+1);
3598
+ pixel.food += 1
3599
+ }
3600
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sapling") {
3601
+ deletePixel(pixel.x+1, pixel.y);
3602
+ pixel.food += 1
3603
+ }
3604
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sapling") {
3605
+ deletePixel(pixel.x-1, pixel.y);
3606
+ pixel.food += 1
3607
+ }
3608
+ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pinecone") {
3609
+ deletePixel(pixel.x, pixel.y-1);
3610
+ pixel.food += 1
3611
+ }
3612
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pinecone") {
3613
+ deletePixel(pixel.x, pixel.y+1);
3614
+ pixel.food += 1
3615
+ }
3616
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pinecone") {
3617
+ deletePixel(pixel.x+1, pixel.y);
3618
+ pixel.food += 1
3619
+ }
3620
+ else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pinecone") {
3621
+ deletePixel(pixel.x-1, pixel.y);
3622
+ pixel.food += 1
3623
+ }
3624
+ }
3625
+ if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) {
3626
+ createPixel("organism", pixel.x, pixel.y-1);
3627
+ pixel.food -= 5;
3628
+ if (Math.random() > 0.8) {
3629
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1;
3630
+ }
3631
+ if (Math.random() < 0.2) {
3632
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1;
3633
+ }
3634
+ else {
3635
+ pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode;
3636
+ }
3637
+ if (Math.random() > 0.995) {
3638
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1;
3639
+ }
3640
+ if (Math.random() < 0.005) {
3641
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1;
3642
+ }
3643
+ else {
3644
+ pixelMap[pixel.x][pixel.y-1].vore = pixel.vore;
3645
+ }
3646
+ }
3647
+ else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) {
3648
+ createPixel("organism", pixel.x+1, pixel.y);
3649
+ pixel.food -= 5;
3650
+ if (Math.random() > 0.8) {
3651
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1;
3652
+ }
3653
+ if (Math.random() < 0.2) {
3654
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1;
3655
+ }
3656
+ else {
3657
+ pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode;
3658
+ }
3659
+ if (Math.random() > 0.995) {
3660
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1;
3661
+ }
3662
+ if (Math.random() < 0.005) {
3663
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1;
3664
+ }
3665
+ else {
3666
+ pixelMap[pixel.x+1][pixel.y].vore = pixel.vore;
3667
+ }
3668
+ }
3669
+ else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) {
3670
+ createPixel("organism", pixel.x-1, pixel.y);
3671
+ pixel.food -= 5;
3672
+ if (Math.random() > 0.8) {
3673
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1;
3674
+ }
3675
+ if (Math.random() < 0.2) {
3676
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1;
3677
+ }
3678
+ else {
3679
+ pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode;
3680
+ }
3681
+ if (Math.random() > 0.995) {
3682
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1;
3683
+ }
3684
+ if (Math.random() < 0.005) {
3685
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1;
3686
+ }
3687
+ else {
3688
+ pixelMap[pixel.x-1][pixel.y].vore = pixel.vore;
3689
+ }
3690
+ }
3691
+ if (pixel.age > 10000 || pixel.dead === true) {
3692
+ if (Math.random() > 0.3) {
3693
+ if (pixel.vore > 0) {
3694
+ changePixel(pixel,"rotten_meat");
3695
+ }
3696
+ else if (pixel.vore < 0) {
3697
+ changePixel(pixel,"dead_plant");
3698
+ }
3699
+ else if (pixel.vore === 0) {
3700
+ changePixel(pixel,"sugar");
3701
+ }
3702
+ }
3703
+ else if (Math.random() > 0.5) {
3704
+ if (pixel.vore > 0) {
3705
+ changePixel(pixel,"meat");
3706
+ }
3707
+ else if (pixel.vore < 0) {
3708
+ changePixel(pixel,"grass");
3709
+ }
3710
+ else if (pixel.vore === 0) {
3711
+ changePixel(pixel,"sugar");
3712
+ }
3713
+ }
3714
+ }
3715
+ pixel.age += 1
3716
+ }
3717
+ pixel.oldvore = pixel.vore
3718
+ },
3719
+ reactions: {
3720
+ "cancer": { elem1:"cancer", chance:0.005 },
3721
+ "radiation": { elem1:["ash","grass","meat","cooked_meat","dead_plant","dna","sugar"], chance:0.4, func:function(pixel) {
3722
+ if (pixel1.vore > 2) {
3723
+ changePixel(pixel,"cooked_meat");
3724
+ }
3725
+ else if (pixel1.vore < -2) {
3726
+ changePixel(pixel,"dead_plant");
3727
+ }
3728
+ else if (pixel1.vore > -3 && pixel1.vore < 3) {
3729
+ changePixel(pixel,"ash");
3730
+ }
3731
+ }},
3732
+ },
3733
+ burn: 10,
3734
+ burnTime: 250,
3735
+ burnInto: ["cooked_meat","dead_plant","dna","sugar"],
3736
+ tempHigh: 150,
3737
+ stateHigh: ["cooked_meat","dead_plant","dna","sugar"],
3738
+ tempLow: -50,
3739
+ stateLow: ["frozen_meat","frozen_plant","dna","sugar"],
3740
+ breakInto: ["rotten_meat","dead_plant","dna","sugar"],
3741
+ category: "organism",
3742
+ state: "solid",
3743
+ density: 1050
3744
+ }
3745
+
3746
+ elements.food_pill = {
3747
+ behavior: behaviors.POWDER,
3748
+ reactions: {
3749
+ "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) {
3750
+ if (pixel2.vore > 2) {
3751
+ pixel2.food += 2
3752
+ if (Math.random() > 0.9) {
3753
+ pixel2.geneticCode += 1
3754
+ };
3755
+ }
3756
+ else if (pixel2.vore < -2) {
3757
+ pixel2.food += 2
3758
+ if (Math.random() > 0.9) {
3759
+ pixel2.geneticCode += 1
3760
+ };
3761
+ }
3762
+ else if (pixel2.vore > -3 && pixel2.vore < 3) {
3763
+ pixel2.food += 5
3764
+ if (Math.random() > 0.9) {
3765
+ pixel2.geneticCode += 1
3766
+ };
3767
+ }
3768
+ }},
3769
+ },
3770
+ category: "organism",
3771
+ state: "solid",
3772
+ color: ["#2b1107","#5c3322","#2b1107","#5c3322","#2b1107","#5c3322"],
3773
+ tempHigh: 250,
3774
+ stateHigh: ["sugar","cooked_meat","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench"],
3775
+ burn: 10,
3776
+ burnTime: 200,
3777
+ burnInto: ["sugar","cooked_meat","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench"],
3778
+ breakInto: ["sugar","cooked_meat","dead_plant","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust"],
3779
+ breakIntoColor: ["#2b1107","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#41770B","#774C35"],
3780
+ isFood: true
3781
+ }
3782
+
3783
+ elements.pacifism_pill = {
3784
+ behavior: behaviors.POWDER,
3785
+ reactions: {
3786
+ "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) {
3787
+ if (pixel2.vore > 0) {
3788
+ pixel2.vore -= 1
3789
+ if (Math.random() > 0.9) {
3790
+ pixel2.food += 1
3791
+ };
3792
+ if (Math.random() > 0.9) {
3793
+ pixel2.geneticCode += 1
3794
+ };
3795
+ }
3796
+ else if (pixel2.vore < 0) {
3797
+ pixel2.vore -= 1
3798
+ pixel2.food += 1
3799
+ if (Math.random() > 0.9) {
3800
+ pixel2.geneticCode += 1
3801
+ };
3802
+ }
3803
+ else if (pixel2.vore === 0) {
3804
+ pixel2.vore -= 1
3805
+ if (Math.random() > 0.9) {
3806
+ pixel2.food += 1
3807
+ };
3808
+ if (Math.random() > 0.9) {
3809
+ pixel2.geneticCode += 1
3810
+ };
3811
+ }
3812
+ }},
3813
+ },
3814
+ category: "organism",
3815
+ state: "solid",
3816
+ color: ["#58AA38","#58AA38","#3D6D4B","#316232","#6CA65A","#58AA38","#3D6D4B","#316232","#58AA38","#58AA38","#3D6D4B","#316232"],
3817
+ tempHigh: 250,
3818
+ stateHigh: ["molten_plastic","dead_plant","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench","stench"],
3819
+ burn: 10,
3820
+ burnTime: 200,
3821
+ burnInto: ["molten_plastic","dead_plant","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench","stench"],
3822
+ breakInto: ["dead_plant","dust","dust","dust","dust","dust","dust"],
3823
+ breakIntoColor: ["#6CA65A","#58AA38","#6CA65A","#6CA65A"],
3824
+ isFood: true
3825
+ }
3826
+
3827
+ elements.neutrality_pill = {
3828
+ behavior: behaviors.POWDER,
3829
+ reactions: {
3830
+ "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) {
3831
+ if (pixel2.vore > 0) {
3832
+ pixel2.vore -= 1
3833
+ if (Math.random() > 0.9) {
3834
+ pixel2.food += 1
3835
+ };
3836
+ if (Math.random() > 0.9) {
3837
+ pixel2.geneticCode += 1
3838
+ };
3839
+ }
3840
+ else if (pixel2.vore < 0) {
3841
+ pixel2.vore += 1
3842
+ if (Math.random() > 0.9) {
3843
+ pixel2.food += 1
3844
+ };
3845
+ if (Math.random() > 0.9) {
3846
+ pixel2.geneticCode += 1
3847
+ };
3848
+ }
3849
+ else if (pixel2.vore === 0) {
3850
+ pixel2.food += 1
3851
+ if (Math.random() > 0.9) {
3852
+ pixel2.geneticCode += 1
3853
+ };
3854
+ }
3855
+ }},
3856
+ },
3857
+ category: "organism",
3858
+ state: "solid",
3859
+ color: ["#c5dede","#c5dede","#464196","#2E2B64","#a4b3b3","#c5dede","#464196","#2E2B64","#c5dede","#c5dede","#464196","#2E2B64"],
3860
+ tempHigh: 250,
3861
+ stateHigh: ["molten_plastic","sugar","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench"],
3862
+ burn: 10,
3863
+ burnTime: 200,
3864
+ burnInto: ["molten_plastic","sugar","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench"],
3865
+ breakInto: ["sugar","dust","dust","dust","dust","dust","dust"],
3866
+ breakIntoColor: ["#a4b3b3","#c5dede","#a4b3b3","#a4b3b3"],
3867
+ isFood: true
3868
+ }
3869
+
3870
+ elements.aggression_pill = {
3871
+ behavior: behaviors.POWDER,
3872
+ reactions: {
3873
+ "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) {
3874
+ if (pixel2.vore > 0) {
3875
+ pixel2.vore += 1
3876
+ pixel2.food += 1
3877
+ if (Math.random() > 0.9) {
3878
+ pixel2.geneticCode += 1
3879
+ };
3880
+ }
3881
+ else if (pixel2.vore < 0) {
3882
+ pixel2.vore += 1
3883
+ if (Math.random() > 0.9) {
3884
+ pixel2.food += 1
3885
+ };
3886
+ if (Math.random() > 0.9) {
3887
+ pixel2.geneticCode += 1
3888
+ };
3889
+ }
3890
+ else if (pixel2.vore === 0) {
3891
+ pixel2.vore += 1
3892
+ if (Math.random() > 0.9) {
3893
+ pixel2.food += 1
3894
+ };
3895
+ if (Math.random() > 0.9) {
3896
+ pixel2.geneticCode += 1
3897
+ };
3898
+ }
3899
+ }},
3900
+ },
3901
+ category: "organism",
3902
+ state: "solid",
3903
+ color: ["#B13E3E","#B13E3E","#8E122A","#870C1C","#A83232","#B13E3E","#8E122A","#870C1C","#B13E3E","#B13E3E","#8E122A","#870C1C"],
3904
+ tempHigh: 250,
3905
+ stateHigh: ["molten_plastic","cooked_meat","smoke","smoke","smoke","cooked_meat","smoke","smoke","smoke","stench","stench"],
3906
+ burn: 10,
3907
+ burnTime: 200,
3908
+ burnInto: ["molten_plastic","cooked_meat","smoke","smoke","smoke","cooked_meat","smoke","smoke","smoke","stench","stench"],
3909
+ breakInto: ["cooked_meat","dust","dust","dust","dust","dust","dust"],
3910
+ breakIntoColor: ["#A83232","#B13E3E","#A83232","#A83232"],
3911
+ isFood: true
3912
+ }
3913
+
3914
+ elements.growth_pill = {
3915
+ behavior: behaviors.POWDER,
3916
+ reactions: {
3917
+ "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) {
3918
+ if (pixel2.vore > 0) {
3919
+ if (Math.random() > 0.9) {
3920
+ pixel2.food += 1
3921
+ };
3922
+ if (Math.random() > 0.99) {
3923
+ pixel2.vore += 1
3924
+ };
3925
+ pixel2.geneticCode += 1
3926
+ }
3927
+ else if (pixel2.vore < 0) {
3928
+ if (Math.random() > 0.8) {
3929
+ pixel2.food += 1
3930
+ };
3931
+ if (Math.random() > 0.99) {
3932
+ pixel2.vore -= 1
3933
+ };
3934
+ pixel2.geneticCode += 1
3935
+ }
3936
+ else if (pixel2.vore === 0) {
3937
+ if (Math.random() > 0.75) {
3938
+ pixel2.food += 1
3939
+ };
3940
+ pixel2.geneticCode += 1
3941
+ }
3942
+ }},
3943
+ },
3944
+ category: "organism",
3945
+ state: "solid",
3946
+ color: ["#ECF4B0","#ECF4B0","#D1D099","#CBCA8C","#D2D9A6","#ECF4B0","#D1D099","#CBCA8C","#ECF4B0","#ECF4B0","#D1D099","#CBCA8C"],
3947
+ tempHigh: 250,
3948
+ stateHigh: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"],
3949
+ burn: 10,
3950
+ burnTime: 200,
3951
+ burnInto: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"],
3952
+ breakInto: ["sugar","dust","dust","dust","dust","dust","dust","herb","dust","dust","dust","dust","dust","dust"],
3953
+ breakIntoColor: ["#D2D9A6","#ECF4B0","#D2D9A6","#D2D9A6"],
3954
+ isFood: true
3955
+ }
3956
+
3957
+ elements.antiaging_pill = {
3958
+ name: "anti-aging_pill",
3959
+ behavior: behaviors.POWDER,
3960
+ reactions: {
3961
+ "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) {
3962
+ if (pixel2.age > 99) {
3963
+ pixel2.age -= 100;
3964
+ if (Math.random() > 0.999) {
3965
+ pixel2.food += 1
3966
+ };
3967
+ if (Math.random() > 0.995) {
3968
+ pixel2.geneticCode += 1
3969
+ };
3970
+ }
3971
+ else if (pixel2.age < 100) {
3972
+ pixel2.age = 100;
3973
+ if (Math.random() > 0.999) {
3974
+ pixel2.food += 1
3975
+ };
3976
+ if (Math.random() > 0.995) {
3977
+ pixel2.geneticCode += 1
3978
+ };
3979
+ }
3980
+ }},
3981
+ },
3982
+ category: "organism",
3983
+ state: "solid",
3984
+ color: ["#B8C5C5","#B8C5C5","#9291A6","#8C8B99","#A8AFAF","#B8C5C5","#9291A6","#8C8B99","#B8C5C5","#B8C5C5","#9291A6","#8C8B99"],
3985
+ tempHigh: 250,
3986
+ stateHigh: ["molten_plastic","magnesium","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench","stench"],
3987
+ burn: 10,
3988
+ burnTime: 200,
3989
+ burnInto: ["molten_plastic","magnesium","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench","stench"],
3990
+ breakInto: ["magnesium","dust","dust","dust","dust","dust","dust","sugar","dust","dust","dust","dust","dust","dust"],
3991
+ breakIntoColor: ["#A8AFAF","#B8C5C5","#A8AFAF","#A8AFAF"],
3992
+ isFood: true
3993
+ }
3994
+
3995
+ elements.regression_pill = {
3996
+ behavior: behaviors.POWDER,
3997
+ reactions: {
3998
+ "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) {
3999
+ if (pixel2.vore > 0) {
4000
+ if (Math.random() > 0.9) {
4001
+ pixel2.food += 1
4002
+ };
4003
+ if (Math.random() > 0.99) {
4004
+ pixel2.vore -= 1
4005
+ };
4006
+ pixel2.geneticCode -= 1
4007
+ }
4008
+ else if (pixel2.vore < 0) {
4009
+ if (Math.random() > 0.8) {
4010
+ pixel2.food += 1
4011
+ };
4012
+ if (Math.random() > 0.99) {
4013
+ pixel2.vore += 1
4014
+ };
4015
+ pixel2.geneticCode -= 1
4016
+ }
4017
+ else if (pixel2.vore === 0) {
4018
+ if (Math.random() > 0.75) {
4019
+ pixel2.food += 1
4020
+ };
4021
+ pixel2.geneticCode -= 1
4022
+ }
4023
+ }},
4024
+ },
4025
+ category: "organism",
4026
+ state: "solid",
4027
+ color: ["#c5dede","#c5dede","#D1D099","#CBCA8C","#a4b3b3","#c5dede","#D1D099","#CBCA8C","#c5dede","#c5dede","#D1D099","#CBCA8C"],
4028
+ tempHigh: 250,
4029
+ stateHigh: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"],
4030
+ burn: 10,
4031
+ burnTime: 200,
4032
+ burnInto: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"],
4033
+ breakInto: ["sugar","dust","dust","dust","dust","dust","dust","herb","dust","dust","dust","dust","dust","dust"],
4034
+ breakIntoColor: ["#a4b3b3","#ECF4B0","#a4b3b3","#a4b3b3"],
4035
+ isFood: true
4036
+ }
4037
+
4038
+ /* by nekonico, do not steal!!!!!! >:3*/