in-progress example of multithreading a game using JS