Exemple #1
0
 public static NetworkObject Instance()
 {
     lock (padlock)
     {
         if (instance == null)
         {
             instance = new NetworkObject();
         }
         return instance;
     }
 }
Exemple #2
0
        /// <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);

            gameObject = GameObject.Instance(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height, Content, GraphicsDevice);
            menuObject = MenuObject.Instance(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height, Content);

            networkObject = NetworkObject.Instance();

            menuObject.active = true;

            currentState = menuObject;

            // TODO: use this.Content to load your game content here

            MediaPlayer.Play((Content.Load<Song>("Sound/Stratospheres")));
            MediaPlayer.IsRepeating = true;
        }