public static bool CheckForCollision(Player player)
 {
     //TODO: Implement check for AABB collision
     return true;
 }
Пример #2
0
        /// <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);

            player = new Player("ivancho", 0.0f, 0.0f, Content.Load<Texture2D>("HeroSkin"), 5);

            //this.spriteFont = Content.Load<SpriteFont>("SpriteFont");

            this.map = new Map();

            var bush1 = new MapElement(Content.Load<Texture2D>("bush"), new Point(100,10));
            var bush2 = new MapElement(Content.Load<Texture2D>("bush"), new Point(120,30));
            var bush3 = new MapElement(Content.Load<Texture2D>("bush"), new Point(140,50));
            var bush4 = new MapElement(Content.Load<Texture2D>("bush"), new Point(1300,50));

            map.Initialize(Content.Load<Texture2D>("map"));
            map.AddMapElement(bush1);
            map.AddMapElement(bush2);
            map.AddMapElement(bush3);
            map.AddMapElement(bush4);

            mapPosition = new Vector2(0, 0);

            // TODO: use this.Content to load your game content here
        }