ayoisaiah / snake

Browser based snake game written in TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

With the current code organization how do you

GrosSacASac opened this issue · comments

run 2 games side by side ? it seems not doable with the current design because the code uses global variables for the game.

@GrosSacASac You mean 2 instances of the game? Yeah, you'll need to refactor the code so it creates a new instance of each of the pieces (the snake, food, board, etc). Maybe use a factory function or a class

are you going to do it ?

@GrosSacASac I'll give it a go!

@GrosSacASac I just found time to get to this now. I've refactored the code