コード例 #1
0
        protected override void OnPaint(gPaintEventArgs e)
        {
            if (this.m_bmp != null)
            {
                int index = 0;
                switch (this.m_face)
                {
                    case FaceDirection.Down:
                        index = 2;
                        break;
                    case FaceDirection.Left:
                        index = 4;
                        break;
                    case FaceDirection.Right:
                        index = 6;
                        break;
                    default:
                        break;
                }

                if (this.m_alt)
                {
                    index++;
                }

                try
                {
                    this.m_image = this.m_bmp[index];
                    this.m_alt = !this.m_alt;
                }
                catch
                {
                }
            }

            base.OnPaint(e);
        }
コード例 #2
0
        protected override void OnPaint(gPaintEventArgs e)
        {
            int index = 0;
            switch (this.m_face)
            {
                case FaceDirection.Down:
                    index = 2;
                    break;
                case FaceDirection.Left:
                    index = 4;
                    break;
                case FaceDirection.Right:
                    index = 6;
                    break;
                default:
                    break;
            }

            if (this.m_alt)
            {
                index++;
            }

            try
            {
                if ((this.m_withBonus) && (this.m_bonusAlt > 1))
                {
                    if (this.m_bmpBonus != null) this.m_image = this.m_bmpBonus[index];
                }
                else
                {
                    if (this.m_bmp != null) this.m_image = this.m_bmp[index];
                }

                this.m_alt = !this.m_alt;

                this.m_bonusAlt++;
                if (this.m_bonusAlt > 3) this.m_bonusAlt = 0;
            }
            catch (Exception ex)
            {
                TRACE(ex.Message);
            }

            base.OnPaint(e);
        }
コード例 #3
0
ファイル: GamePanel.cs プロジェクト: soeminnminn/BattleCity
        protected override void OnPaint(gPaintEventArgs e)
        {
            base.OnPaint(e);

            if (this.m_life > 0)
            {
                Point pText = new Point(180, 300);

                if (this.m_tick < 10)
                    this.m_font.Write(e.Value, sLoading, pText);
                else if ((this.m_tick >= 10) && (this.m_tick < 20))
                    this.m_font.Write(e.Value, sLoading + ".", pText);
                else if ((this.m_tick >= 20) && (this.m_tick < 30))
                    this.m_font.Write(e.Value, sLoading + "..", pText);
                else if (this.m_tick > 30)
                    this.m_font.Write(e.Value, sLoading + "...", pText);

                this.m_tick++;
                if (this.m_tick == 40) this.m_tick = 0;
            }
        }
コード例 #4
0
ファイル: GamePanel.cs プロジェクト: soeminnminn/BattleCity
        protected override void OnPaint(gPaintEventArgs e)
        {
            Graphics graphics = e.Value;

            base.OnPaint(e);

            this.m_font.Write(graphics, this.m_lifeCount1.ToString(), new Point(this.m_x + 24, this.m_y + 216));

            if (this.m_player2 != null)
            {
                this.m_font.Write(graphics, this.m_lifeCount2.ToString(), new Point(this.m_x + 24, this.m_y + 256));
            }

            if (!string.IsNullOrEmpty(this.m_state)) this.m_font.Write(graphics, this.m_state, new Point(this.m_x + 24, this.m_y + 314));
        }
コード例 #5
0
 protected override void OnPaint(gPaintEventArgs e)
 {
     if (this.m_alt < 20) base.OnPaint(e);
     this.m_alt++;
     if (this.m_alt == 40) this.m_alt = 0;
 }
コード例 #6
0
        protected override void OnPaint(gPaintEventArgs e)
        {
            if ((this.m_isHomeCover) && (this.m_bmp != null) && (this.m_life > 0))
            {
                if (this.m_blocked < 0)
                {
                    this.m_type = MapItemTypes.ferum;
                    this.m_image = this.m_bmp[1];
                }
                else if (this.m_blocked > 0)
                {
                    if ((this.m_blocked % 16) < 8)
                    {
                        this.m_type = MapItemTypes.brick;
                        this.m_image = this.m_bmp[0];
                    }
                    else
                    {
                        this.m_type = MapItemTypes.ferum;
                        this.m_image = this.m_bmp[1];
                    }
                    this.m_blocked--;
                }
                else
                {
                    this.m_type = MapItemTypes.brick;
                    this.m_image = this.m_bmp[0];
                }
            }

            if ((this.m_type == MapItemTypes.water) && (this.m_bmp != null))
            {
                this.m_image = (this.m_life <= 20) ? this.m_bmp[0] : this.m_bmp[1];
                this.m_life++;
                if (this.m_life > 40) this.m_life = 1;
            }
            else if ((this.m_type == MapItemTypes.brick) && (this.m_life == 1))
            {
                switch (this.m_face)
                {
                    case FaceDirection.Up:
                        this.m_height = 8;
                        break;
                    case FaceDirection.Down:
                        if (this.m_height != 8)
                            this.m_y += 8;
                        this.m_height = 8;
                        break;
                    case FaceDirection.Left:
                        this.m_width = 8;
                        break;
                    case FaceDirection.Right:
                        if (this.m_width != 8)
                            this.m_x += 8;
                        this.m_width = 8;
                        break;
                }
            }

            base.OnPaint(e);
        }
コード例 #7
0
 protected override void OnPaint(gPaintEventArgs e)
 {
     if (this.m_bmp != null)
     {
         try
         {
             this.m_image = (this.m_life == 2) ? this.m_bmp[0] : this.m_bmp[1];
             base.OnPaint(e);
         }
         catch
         {
         }
     }
 }