My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
ScreenManagerSpecs  
Design Specifications for Screen Manager
Phase-Design
Updated Jun 22, 2008 by privmail...@gmail.com

Introduction

The propose of the Screen Manager is to allow switching between different "screens" of the game.

Definitions/Language

  • SM: Screen Managers
  • screen: Isolated part of the game. A screen could be the gameplay, a menu(main/options/save/load), pause/map screen, or intro animation for game name and production company.
  • MUST: Feature that must be complete before other parts of the game can be built
  • SHOULD: Feature that is required for game completion, but could be delayed until other parts of the game are complete
  • COULD: Feature that would be nice to have but not required

Specifications

  • The SM MUST contain and easy way to switching between screen
  • The SM MUST provide a basic interfaces for all screen(abstract base class)
  • The SM MUST provide an intuitive way to pause the bottom screen(gameplay), while the top screens(map or pause screens) are being shown
  • The SM SHOULD provide a way to show menus that don't suck. Meaning, the menus created by the base menu class should fit with the overall look and feel of the game
  • The SM COULD allow for an easy way to create production and game logos screens

Ideas for implementation

Screen Manager

public class ScreenManager : Microsoft.Xna.Framework.Game
{
	public SpriteBatch SpriteBatch { get; }
	public LineBatch LineBatch { get; }
//Update: call update on top most screen only
//Draw: call draw on all active screen in reverse order
}

Screen

public abstract Screen
{
	ScreenManager sm;

	public Screen(ScreenManager sm) { this.sm = sm;}
	public abstract void Update(GameTime gameTime);
	public abstract void Draw(GameTime gameTime);	
}

Test Screen

public TestScreen : Screen
{
	Part test;

	public TestScreen(ScreenManager sm) : base(sm)
	{
		sm.Content.Load<Part>("sexyhull");
	}

	public override void Update(GameTime gameTime)
	{
		test.Rotation = (float)gameTime.TotalGameTime.TotalSeconds * 2;
	}

	public override void Draw(GameTime gameTime)
	{
		sm.LineDraw.Begin();
		sm.LineDraw.Draw(test);
		sm.LineDraw.End();
	}
}
Powered by Google Project Hosting