-- Setup
entRoot=Game.GetRootEntity();

-- View the scene from a given camera for a given period of time
function ViewFromStaticCamera(camName, duration)
    currentCamera = Entity.FindName(entRoot, camName);
    Game.SetWindowEntity(0, currentCamera);
    Script.WaitSec(duration);
    end

-- Set the scene to the given waypoint camera and reset the camera to
-- the given waypoint for the given duration
function ViewFromWaypointCamera(camName, waypointName, duration)
    currentCamera = Entity.FindName(entRoot, camName);
    Game.SetWindowEntity(0, currentCamera);
    Game.CameraSetWaypoint(currentCamera, waypointName);
    Script.WaitSec(duration);
    end


-- camera shots
ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS0", 3.0);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS3", 5.0);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybyFast", "CW0", 6.0);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS7", 5.0);
ViewFromWaypointCamera("CameraPreRaceFlybyFast", "CW9", 5.0);
ViewFromWaypointCamera("CameraPreRaceToStart", "CTS0", 12.0);

-- calling this signals the game that the intro is over
Game.SetIntroDone(1);
