//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {License Information: Creative Commons} //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace ElementalGame { #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; #endregion // The general CutScene... Screen public class CutSceneScreen : GameScreen { protected List screens = new List(); protected List screenTimeDelays = new List(); protected int currentScreenIndex = 0; protected System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); protected int currentTimeDelay = 0; protected bool isFinished = false; // Constructor: public CutSceneScreen() { //Instantiate the GameMenu menu = new GameMenu("", 0,0); } public void StartCutScene() { stopWatch.Reset(); stopWatch.Start(); currentScreenIndex = 0; SetBackground(screens[currentScreenIndex]); currentTimeDelay = screenTimeDelays[currentScreenIndex]; isFinished = false; } public bool IsDone() { return isFinished; } public void Skip() { isFinished = true; } public new void Draw() { if (stopWatch.ElapsedMilliseconds >= currentTimeDelay) { if (currentScreenIndex == screens.Count - 1) { isFinished = true; } else { currentScreenIndex++; SetBackground(screens[currentScreenIndex]); currentTimeDelay = screenTimeDelays[currentScreenIndex]; } stopWatch.Reset(); stopWatch.Start(); } base.Draw(); } } }