set up game properly, error with animation loop