javascript Snakylines game OOP