public static CharacterManager GetInstance(ContentManager content, GraphicsDeviceManager graphics) { if (instance == null) { instance = new CharacterManager(content, graphics); } return instance; }
public Weapon(ContentManager cm, GraphicsDeviceManager graphics) { mCharManager = CharacterManager.GetInstance(cm, graphics); mTexture = null; mScale = new Vector2(1.0f, 0.0f); mStrikeTime = 0; mStrikePos = Vector2.Zero; mState = states.NORMAL; mOnScreenTime = 0.5f; }
public Weapon(string textureName, ContentManager cm, GraphicsDeviceManager graphics) { mCharManager = CharacterManager.GetInstance(cm, graphics); mTexture = cm.Load<Texture2D>("Weapons/" + textureName); mScale = new Vector2(1.0f, 0.0f); mStrikeTime = 0; mStrikePos = Vector2.Zero; mState = states.NORMAL; mOnScreenTime = 0.5f; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width; graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height; // graphics.PreferredBackBufferWidth = 800; // graphics.PreferredBackBufferHeight = 600; //graphics.ToggleFullScreen(); this.Window.Title = "Too Cute To Live"; graphics.ApplyChanges(); Class1.graph = graphics; mCharacterManager = CharacterManager.GetInstance(Content, graphics); mMenu = new Menu(this); mScoring = new Scoring(); mIntro = new Intro(); mItemManager = new ItemManager(Content); mCam = new Camera(graphics.GraphicsDevice.Viewport); hud = new HUD(); wM = new WeaponManager(Content, graphics); /* Number of seconds the level will run */ timer = 60.0f; temp = rand.Next(0, 10); base.Initialize(); }