Necroing this thread because I want to implement a similar system and my solution causes some performance issues
Develop games in your browser. Powerful, performant & highly capable.