Ejemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Ejemplo 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;
        }
Ejemplo n.º 3
0
 public Projectile(float x, float y)
 {
     this.location = new Vector2(x, y);
     this.game = Game1.GetInstance();
 }
Ejemplo n.º 4
0
 public static Game1 GetInstance()
 {
     if (instance == null)
     {
         instance = new Game1();
     }
     return instance;
 }