# P5.js made non-playable slither.io like design, open source now!

**URL:** <https://discourse.processing.org/t/p5-js-made-non-playable-slither-io-like-design-open-source-now/14822>\
**Category:** Gallery\
**Created:** [October 20, 2019, 12:47pm UTC](https://discourse.processing.org/t/p5-js-made-non-playable-slither-io-like-design-open-source-now/14822 "2019-10-20T12:47:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![technew](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/technew/32/6364_2.png) [@technew](https://discourse.processing.org/u/technew)\
**Post date:** [October 20, 2019, 12:47pm UTC](https://discourse.processing.org/t/p5-js-made-non-playable-slither-io-like-design-open-source-now/14822/1 "2019-10-20T12:47:45Z")

</div>

Something reminds me of this old work today.  
My very old university assignment in processing (p5.js). (2 years ago)  
Since I already graduated, so it might be a good idea to release my source code.

You may find interesting.

This was inspired by [slither.io](http://slither.io).

[https://www.openprocessing.org/sketch/569904](https://www.openprocessing.org/sketch/569904)

You can see the source code by clicking “\</\>” at the centre.

 ![old](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4dfcf146e379db1f3e5da6686fa21d4f38edf19b.png)

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 20, 2019, 3:08pm UTC](https://discourse.processing.org/t/p5-js-made-non-playable-slither-io-like-design-open-source-now/14822/2 "2019-10-20T15:08:24Z")

</div>

Nice, my frameRate is arround 25 on my tablet. Is that reasonable?

---

<div class="post-metadata">

**Author:** ![technew](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/technew/32/6364_2.png) [@technew](https://discourse.processing.org/u/technew)\
**Post date:** [October 20, 2019, 3:33pm UTC](https://discourse.processing.org/t/p5-js-made-non-playable-slither-io-like-design-open-source-now/14822/3 "2019-10-20T15:33:00Z")

</div>

It depends on your mobile chip power.

But on my laptop with 6 core cpu and integrated graphic card (chrome does not support dedicated gpu any more), it could easily handle up to 50 snakes simultaneously at stable 60fps.(frame does drop when over 50 snakes)

It you feel laggy on your tablet, you can change number of snakes in the source code and run again. Just keep in mind, mobile browsers’ JavaScript performance are always not that great.

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [October 20, 2019, 3:53pm UTC](https://discourse.processing.org/t/p5-js-made-non-playable-slither-io-like-design-open-source-now/14822/4 "2019-10-20T15:53:50Z")

</div>

any plans for neural network version?

---

<div class="post-metadata">

**Author:** ![technew](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/technew/32/6364_2.png) [@technew](https://discourse.processing.org/u/technew)\
**Post date:** [October 21, 2019, 6:29am UTC](https://discourse.processing.org/t/p5-js-made-non-playable-slither-io-like-design-open-source-now/14822/5 "2019-10-21T06:29:18Z")

</div>

Currently, no.  
If you modify the parameter a little bit, you can make snakes always avoid crushing with others and detect food with range of the whole map.  
I changed to high chance for these behaviours rather than 100%.
