Example #1
0
        public EnemyChar(Texture2D txr, Vector2 position, Color tint, float scale, int fps, int framesX, int framesY, int maxHealth, float speed, float detectionRadius, float damage, float tickTime, Map map, UniMapData data, ContentManager content, int currentLevel, int currentWave)
            : base(txr, position, tint, scale, fps, framesX, framesY, maxHealth, speed, detectionRadius, damage, tickTime)
        {
            m_collisionCircle = new Circle(m_position.X, m_position.Y, 18);

            m_map    = map;
            m_graph  = new NodeGraph(data);
            m_search = new GBFsearch(m_graph, m_map);

            m_xCoords = (int)(position.X / 36);
            m_yCoords = (int)(position.Y / 36);

            m_vanishTimer = 2;

            m_baseFPS = m_fps;

            m_isShaded = false;

            // Truthfully, this was testing the idea of method chaining
            m_healthBar = new CharHealthBar("Art\\GameArt\\GameplayGUI")
                          .SetPosition(m_position)
                          .LoadShader(content, "Shaders\\HighlightEffect")
                          .LoadTextures(content, "\\EnemyHealthBarBorder", "\\EnemyHealthBar", "\\EnemyHealthBar", 0.5f)
                          .SetHpValues((int)m_health)
                          .SetColours(Color.White, Color.Yellow, Color.Red)
                          .SetParentOfBar(this)
                          .SetScaleBorder(0.5f)
                          .SetScaleBar(1)
                          .SetScaleBacking(1);
        }
Example #2
0
        // Class Constructor.
        public GuardChar(Texture2D txr, Vector2 position, Color tint, float scale, int fps, int framesX, int framesY, int maxHealth, float speed, float detectionRadius, float damage, float tickTime, UniMapData data, ContentManager content, Map map, Vector2 healthBarPosition)
            : base(txr, position, tint, 1, fps, framesX, framesY, maxHealth, speed, detectionRadius, damage, tickTime)
        {
            m_isSelected = false;
            m_isMoving   = false;
            m_isFighting = false;
            m_isShifting = false;
            m_isShaded   = true;
            m_velocity   = Vector2.Zero;
            m_map        = map;
            m_graph      = new NodeGraph(data);
            m_search     = new GBFsearch(m_graph, m_map);
            m_xCoords    = (int)(position.X / 36);
            m_yCoords    = (int)(position.Y / 36);

            m_path = new Queue <MapTile>();

            m_healthBar = new CharHealthBar("Art\\GameArt\\GameplayGUI")
                          .SetPosition(healthBarPosition)
                          .LoadShader(content, "Shaders\\SmallHighlightEffect")
                          .LoadTextures(content, "\\AllyHealthBarBorder", "\\AllyHealthBar", "\\AllyHealthBar", 1)
                          .SetHpValues((int)m_health)
                          .SetColours(Color.White, Color.Yellow, Color.Red)
                          .SetParentOfBar(this);
        }