added collision detection for game objects