예제 #1
0
 /// <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;
        }