working game logic with angular