Esempio n. 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Esempio n. 2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // Extend battery life under lock.
            InactiveSleepTime = TimeSpan.FromSeconds(1);

            // Set default orientation to landscape
            graphics.PreferredBackBufferWidth = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;

            instance = this;

            TouchPanel.EnabledGestures = GestureType.HorizontalDrag;
        }
Esempio n. 3
0
 public Projectile(float x, float y)
 {
     this.location = new Vector2(x, y);
     this.game = Game1.GetInstance();
 }
Esempio n. 4
0
 public static Game1 GetInstance()
 {
     if (instance == null)
     {
         instance = new Game1();
     }
     return instance;
 }