Example #1
0
        /// <summary>
        /// Create a new RolePlayingGame object.
        /// </summary>
        public RolePlayingGame()
        {
            // initialize the graphics system
            graphics = new GraphicsDeviceManager(this);
            //graphics.PreferredBackBufferWidth = 1280;
            //graphics.PreferredBackBufferHeight = 720;

            graphics.PreferredBackBufferWidth = 1024;
            graphics.PreferredBackBufferHeight = 768;

            graphics.IsFullScreen = false;

            // configure the content manager
            Content.RootDirectory = "Content";

            // add a gamer-services component, which is required for the storage APIs
            //Components.Add(new GamerServicesComponent(this));

            // add the audio manager
            AudioManager.Initialize(this, @"Content\Audio\RpgAudio.xgs",
                @"Content\Audio\Wave Bank.xwb", @"Content\Audio\Sound Bank.xsb");

            // add the screen manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);
        }
Example #2
0
        /// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow,
                              GameScreen[] screensToLoad)
        {
            this.loadingIsSlow = loadingIsSlow;
            this.screensToLoad = screensToLoad;

            TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
Example #3
0
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager, bool loadingIsSlow,
                                params GameScreen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen(screenManager,
                                                            loadingIsSlow,
                                                            screensToLoad);

            screenManager.AddScreen(loadingScreen);
        }
        /// <summary>
        /// Create a new RolePlayingGame object.
        /// </summary>
        public RolePlayingGame()
        {
			//TouchPanel.EnabledGestures =GestureType.Tap | GestureType.VerticalDrag | GestureType.HorizontalDrag
			//	| GestureType.Flick;

		
            // initialize the graphics system
            graphics = new GraphicsDeviceManager(this);
			graphics.PreferMultiSampling = true;
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;
			//TouchPanel.DisplayWidth = 1280;
			//TouchPanel.DisplayHeight = 720;
			//TouchPanel.EnableMouseGestures = true;
			TouchPanel.EnableMouseTouchPoint = true;


            adultMode = true;
     
            // configure the content manager
            Content.RootDirectory = "Content";
            // add a gamer-services component, which is required for the storage APIs
           Components.Add(new GamerServicesComponent(this));

            // add the audio manager
            //AudioManager.Initialize(this, @"Content\Audio\RpgAudio.xgs", @"Content\Audio\Wave Bank.xwb", @"Content\Audio\Sound Bank.xsb");

            // add the screen manager
            screenManager = new ScreenManager(this);
            AudioManager.AddContentManager(this.Content);
  
            Components.Add(screenManager);


            this.IsMouseVisible = true;
			//UIApplication.SharedApplication.TouchesEnded = delegate {
			//		System.Diagnostics.Debug.WriteLine("Touch? " + TouchPanel.IsGestureAvailable);

			//};
        }
Example #5
0
        /// <summary>
        /// Create a new RolePlayingGame object.
        /// </summary>
        public RolePlayingGame()
        {
            // initialize the graphics system
            graphics = new GraphicsDeviceManager(this);
            StaticContent = new ContentManager(this.Services);

            // configure the content manager
            Content.RootDirectory = "Content";
            StaticContent.RootDirectory = "Content";

            graphics.IsFullScreen = true;
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 480;

            // add the audio manager
            AudioManager.Initialize(this);

            // add the screen manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);
        }
Example #6
0
        /// <summary>
        /// Start a new session, using the data in the given save game.
        /// </summary>
        /// <param name="saveGameDescription">The description of the save game.</param>
        /// <param name="screenManager">The ScreenManager for the new session.</param>
        public static void LoadSession(SaveGameDescription saveGameDescription,
            ScreenManager screenManager, GameplayScreen gameplayScreen)
        {
            // check the parameters
            if (saveGameDescription == null)
            {
                throw new ArgumentNullException("saveGameDescription");
            }
            if (screenManager == null)
            {
                throw new ArgumentNullException("screenManager");
            }
            if (gameplayScreen == null)
            {
                throw new ArgumentNullException("gameplayScreen");
            }

            // end any existing session
            EndSession();

            // create the new session
            singleton = new Session(screenManager, gameplayScreen);

            // get the storage device and load the session
            GetStorageDevice(
                delegate(StorageDevice storageDevice)
                {
                    LoadSessionResult(storageDevice, saveGameDescription);
                });
        }
Example #7
0
        /// <summary>
        /// Private constructor of a Session object.
        /// </summary>
        /// <remarks>
        /// The lack of public constructors forces the singleton model.
        /// </remarks>
        private Session(ScreenManager screenManager, GameplayScreen gameplayScreen)
        {
            // check the parameter
            if (screenManager == null)
            {
                throw new ArgumentNullException("screenManager");
            }
            if (gameplayScreen == null)
            {
                throw new ArgumentNullException("gameplayScreen");
            }

            // assign the parameter
            this.screenManager = screenManager;
            this.gameplayScreen = gameplayScreen;

            // create the HUD interface
            this.hud = new Hud(screenManager);
            this.hud.LoadContent();
        }
Example #8
0
        /// <summary>
        /// Start a new session based on the data provided.
        /// </summary>
        public static void StartNewSession(GameStartDescription gameStartDescription,
            ScreenManager screenManager, GameplayScreen gameplayScreen)
        {
            // check the parameters
            if (gameStartDescription == null)
            {
                throw new ArgumentNullException("gameStartDescripton");
            }
            if (screenManager == null)
            {
                throw new ArgumentNullException("screenManager");
            }
            if (gameplayScreen == null)
            {
                throw new ArgumentNullException("gameplayScreen");
            }

            // end any existing session
            EndSession();

            // create a new singleton
            singleton = new Session(screenManager, gameplayScreen);

            // set up the initial map
            ChangeMap(gameStartDescription.MapContentName, null);

            // set up the initial party
            ContentManager content = singleton.screenManager.Game.Content;
            singleton.party = new Party(gameStartDescription, content);

            // load the quest line
            singleton.questLine = content.Load<QuestLine>(
                Path.Combine(@"Quests\QuestLines",
                gameStartDescription.QuestLineContentName)).Clone() as QuestLine;
        }
Example #9
0
        /// <summary>
        /// Creates a new Hud object using the given ScreenManager.
        /// </summary>
		public Hud(ScreenManager _screenManager)
        {
            // check the parameter
			if (_screenManager == null)
            {
                throw new ArgumentNullException("screenManager");
            }
			this.screenManager = _screenManager;
        }
Example #10
0
        /// <summary>
        /// Creates a new Hud object using the given ScreenManager.
        /// </summary>
        public Hud(ScreenManager screenManager)
        {
            // check the parameter
            if (screenManager == null)
            {
                throw new ArgumentNullException("screenManager");
            }
            this.screenManager = screenManager;

            IsActive = true;
        }