from scratch tactris.js