DodongosQuest.World.PlayerHasExploredWorldIndex C# (CSharp) Method

PlayerHasExploredWorldIndex() public method

public PlayerHasExploredWorldIndex ( Vector2 worldIndex ) : bool
worldIndex Vector2
return bool
        public bool PlayerHasExploredWorldIndex(Vector2 worldIndex)
        {
            if (Tiles[(int)worldIndex.X, (int)worldIndex.Y].IsExploredByPlayer == true)
                return true;
            else
                return false;
        }

Usage Example

Exemplo n.º 1
0
        public void Draw(GameTime gameTime)
        {
            if (_world.PlayerHasExploredWorldIndex(WorldIndex))
            {
                Vector2 worldPosition  = _world.ConvertTileIndexToWorldPosition(WorldIndex.X, WorldIndex.Y);
                Vector2 screenPosition = Camera.GetScreenPosition(worldPosition);

                if (IsOpen)
                {
                    GraphicsHelper.spriteBatch.Draw(_openImage, screenPosition, null, Color.White, 0f, new Vector2(0, 0), 1f, SpriteEffects.None, 0.7f);
                }
                else
                {
                    GraphicsHelper.spriteBatch.Draw(_closedImage, screenPosition, null, Color.White, 0f, new Vector2(0, 0), 1f, SpriteEffects.None, 0.7f);
                }
            }
        }