コード例 #1
0
ファイル: GameObject.cs プロジェクト: bjorfoss/XNAX1
 /// <summary>
 /// Call this for first time setup of the GameObject
 /// </summary>
 /// <param name="w"></param>
 /// <param name="h"></param>
 /// <param name="Content"></param>
 /// <param name="defaultGoalLimit"></param>
 /// <returns></returns>
 public static GameObject Instance(int w, int h, ContentManager Content,GraphicsDevice graphicsDevice, int defaultGoalLimit=2)
 {
     lock (padlock) {
         if (instance == null)
         {
             instance = new GameObject(w, h, Content, defaultGoalLimit, graphicsDevice);
         }
         return instance;
     }
 }
コード例 #2
0
ファイル: Game1.cs プロジェクト: bjorfoss/XNAX1
        /// <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;
        }