예제 #1
0
        public void Update(GameTime gameTime, Player player, QuarryManagement management)
        {
            rect      = new Rectangle((int)position.X, (int)position.Y, objectTexture.Width, objectTexture.Height);
            position += velocity;
            int i = 1;

            velocity.Y += i * .15f;
            PlayerCollision(player);
            DrillCollision(management);
            DeathTimer(gameTime);
        }
예제 #2
0
 public void DrillCollision(QuarryManagement management)
 {
     foreach (QuarryDrill qDrill in management.drills)
     {
         if (qDrill.rect.Intersects(rect))
         {
             qDrill.tile.inventory.AddToInventory(item, 1);
             alive = false;
         }
     }
 }
예제 #3
0
        protected override void LoadContent()
        {
            keyboardState = new KeyboardState(); 

            spriteBatch = new SpriteBatch(GraphicsDevice);
                       

            tileMap = new TileMap(mapSize, seed, true);
            tileMap.LoadContent(Content);

            player = new Player(tileMap.playerStart);
            player.LoadContent(Content);
      
            tileObjectManagement = new TileObjectManagement(this);
            quarryManagement = new QuarryManagement(); 
            gui.LoadContnent(Content, GraphicsDevice);

            rectangleTexture = new Texture2D(GraphicsDevice, 1, 1);
            rectangleTexture.SetData(new[] { Color.White });

        }