Exemplo n.º 1
0
 public void DrawNPC(GameTime gameTime, SpriteBatch spriteBatch)
 {
     if (TileNPC != null)
     {
         TileNPC.Draw(gameTime, spriteBatch);
         //Console.WriteLine($"Drawing NPC@:> {TileIndex}");
     }
 }
Exemplo n.º 2
0
        public void DebugUpdate(GameTime gameTime, KeyboardState keyboardState, Camera camera)
        {
            // debug hovering only works when the camera zoom is set to 1.0f

            var ms = Mouse.GetState();
            var b  = camera.GetBounds();
            var mr = new Rectangle(b.X + ms.Position.X, b.Y + 142 + ms.Position.Y, 1, 1);

            if (mr.Intersects(new Rectangle((int)Position.X + 16, (int)Position.Y + 16, Texture.Width / 2, Texture.Height / 2)))
            {
                // mouse is hovering
                Console.WriteLine($"Tile {TileIndex} is currently hovered");
                ShowOutline     = true;
                OutlineCooldown = 25;
            }

            if (TileNPC != null)
            {
                TileNPC.Update(gameTime, keyboardState);
            }
        }