public UserControlledSprite() { m_ColorOnMap = Color.Blue; bActive = true; bMovingTowardsTarget = false; m_CurrDirection = BattleShip.Core.Utils.Common.Direction.Down; m_InputManager = new InputManager(); m_iDeltaY = m_iDeltaX = 5; }
public TextMenuComponent(Game game, SpriteFont normalFont, SpriteFont selectFont, Texture2D textureButton) : base(game) { m_textureButton = textureButton; m_ButtonRect = new Rectangle(0, 0, m_textureButton.Width, m_textureButton.Height); m_regularFont = normalFont; m_selectedFont = selectFont; this.m_menuItems = new List<string>(); m_spriteBatch = game.Services.GetService(typeof(SpriteBatch)) as SpriteBatch; m_inputManager = new InputManager(); m_SelectedMenuItem = GameMenuItem.None; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); this.Services.AddService(typeof(SpriteBatch), spriteBatch); // TODO: use this.Content to load your game content here //load all sounds SoundManager.LoadContent(Content); //load all resource m_ResourceManager = new ResourceManager(this.Content); m_ResourceManager.LoadAllResource(); this.Services.AddService(typeof(ResourceManager), m_ResourceManager); m_InputManager = new InputManager(); //load scences m_HelpScence = new HelpScence(this, ResourceManager.imgBackgroundHelpScence, ResourceManager.imgForegroundHelpScence); m_StartScence = new StartScence(this, ResourceManager.smallFont, ResourceManager.largeFont, ResourceManager.imgBackgroundStartScence, ResourceManager.imgForegroundStartScence, ResourceManager.imgButton); m_ActionScence = new ActionScence(this); this.Components.Add(m_HelpScence); this.Components.Add(m_StartScence); this.Components.Add(m_ActionScence); //begin at start scence m_StartScence.ShowScreen(); this.m_ActiveScence = m_StartScence; }