コード例 #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
コード例 #2
0
ファイル: Object.cs プロジェクト: markustenghamn/XboxGameTest
        public Object(Game1 game, ContentManager content, GraphicsDeviceManager graphics, float x, float y, int type, SpriteBatch spriteBatch)
        {
            position = new Vector2(x, y);
            if (type == 1 || type == 2)
            {
                size = new Vector2(50, 50);
            }
            else if (type == 3 || type == 4 || type == 5 || type == 6)
            {
                size = new Vector2(25, 25);
            }

            if (type == 3)
            {
                dir2 = new Vector2 (-2f, -2f);
            }
            else if (type == 4)
            {
                dir2 = new Vector2(-2f, 2f);
            }
            else if (type == 5)
            {
                dir2 = new Vector2(2f, -2f);
            }
            else if (type == 6)
            {
                dir2 = new Vector2(2f, 2f);
            }
            objectTexture = new Texture2D(graphics.GraphicsDevice, 1, 1);
            objectTexture.SetData<Color>(new[] { objectColor });
            this.spriteBatch = spriteBatch;
            this.type = type;
            this.graphics = graphics;
            this.game = game;
            this.content = content;
            lifeFont = content.Load<SpriteFont>("objectLife");
        }