Ejemplo n.º 1
0
 public HUD(Game game, Player player, int bulletAmount, int maxBullets, ContentManager content, SpriteBatch spriteBatch)
     : base(game)
 {
     this.game = game;
     this.player = player;
     this.bulletAmount = bulletAmount;
     this.maxBullets = maxBullets;
     reticule = content.Load<Texture2D>("Untitled");
     healthBar = content.Load<Texture2D>("HealthBar");
     this.viewportCentre = new Vector2(game.Window.ClientBounds.Width / 2, game.Window.ClientBounds.Height / 2);
     spriteOrigin = new Vector2(reticule.Width / 2, reticule.Height / 2);
     messageList = new List<message>();
     this.spriteBatch = spriteBatch;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a new lobby screen.
        /// </summary>
        public LobbyScreen(NetworkSession networkSession)
        {
            this.networkSession = networkSession;

            networkSession.GamerJoined += GamerJoined;

            networkHelper = new NetworkHelper();

            GetVariables();

            if (networkSession.LocalGamers.Count > 0)
            {
                localPlayer = networkSession.LocalGamers[0].Tag as Player;
            }

            // Adds a simple message to tell the user what to do.
            // Since we will be using the guide to get commands,
            // we need to tell them how to open it up!
            messages.Add(new string[] { "System", "Press [Tab] to send a message " });

            /*
            if (audioHelper == null)
                this.audioHelper = new Audio("Content\\TRA_Game.xgs");
            else
                this.audioHelper = audioHelper;
            if (audio_on == false)
            {
                mystery = this.audioHelper.GetCue("mystery");
                this.audioHelper.Play(mystery, false, new AudioListener(), new AudioEmitter());
            }
            else
                mystery = this.audioHelper.GetCue("mystery");

            this.audioHelper.Update();*/
            TransitionOnTime = TimeSpan.FromSeconds(0.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);
        }