void ObstacleSpawner::GenerateObstacle(const Vector2D & pos,int i) { Obstacles * obstacle = _obstacleArray[i]->Clone(); Vector2D scenePos = Vector2D::ZERO; scenePos.x = pos.x; scenePos.y = pos.y-2*obstacle->GetCenter().y; obstacle->SetPosition(scenePos); SceneManager::GetInstance()->AddActorToLayer("obstacle", obstacle); _nextpos.x+=2*obstacle->GetCenter().x; }