Skip to content
Hi frand, beleve in bein a snek
PHP JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Sn4k3 - next generation MMO

Frendly snek

Frendly snek demo

Documentation index

Requirements (if you don't have Docker)

  • PHP >=7.0
  • Python >=2.7 (with pip)
  • NodeJS >=4.4 (with npm)


With Docker

Just run docker-compose build.

Without Docker

Execute all these commands directly from the root directory of the repository.

pip install crossbar
composer --working-dir=backend install
cd frontend
npm install
npm run build


With Docker

Just execute docker-compose up -d

And go to

Without docker

You will need at least 3 terminals for this, because all apps need to be run independently.

Run Crossbar middleware instance

crossbar start --config=crossbar/config.json

Run the php broadcast application

php backend/broadcast.php

And finally execute nodejs static server

cd frontend
node server.js

And go to



On EVERY tick, the app checks collisions for every "snake head vs any other object".

In this case, we make other naive/less precise assumptions.

  1. First, we check the distance between each object's center (because we're making comparisons on circles, most of the time). It's very fast because it just compares two values.
  2. Next, we calculate a rectangle hitbox collision, which is slower but still faster than a precise text.
  3. And finally we make a geometrical comparison of circles, which is very slow.

Here are some benchmarks about this:

Assumption type   Naive Rectangle Circle
Total calculations 200000 70000 20
Average time 1500 8300 18000
You can’t perform that action at this time.