game logic to split from html