Exemplo n.º 1
0
 public ClassBossBeeBull(Device gd, int BX, int EX, int Y, status_BullStatus Current_BeeBullStatus, List <Bitmap> BmpBossBeeBullList)
 {
     this.BmpBossBeeBullList = BmpBossBeeBullList;
     this.Current_BullStatus = Current_BeeBullStatus;
     this.BX  = BX - Width / 2;
     this.EX  = EX;
     this.Y   = Y;
     Distance = Math.Sqrt((BX - EX) * (BX - EX) + Y * Y);
     DX       = EX - BX;
     DY       = Y;
 }
Exemplo n.º 2
0
 public ClassBeeBull(Device gd, int BX, int EX, int Y, status_BullStatus Current_BeeBullStatus, List <Bitmap> BmpBeeBullList)
 {
     this.BmpBeeBullList     = BmpBeeBullList;
     this.Current_BullStatus = Current_BeeBullStatus;
     this.BX  = BX - Width / 2;
     this.EX  = EX;
     this.Y   = Y;
     Distance = Math.Sqrt((BX - EX) * (BX - EX) + Y * Y);
     DX       = EX - BX;
     DY       = Y;
     // s_bull = new Sprite(gd);
     //  showPicture = new Texture(gd, BmpBeeBullList[0], 0, Pool.Managed);
 }
Exemplo n.º 3
0
        public ClassPlayerBull(Device gd, int BX, int EX, int Y, bool Big_Bull, status_BullType Current_BullType, status_BullStatus Current_BullStatus, List <Bitmap> BmpPlayerBullList, List <Bitmap> BmpPlayerBullLinkBombList)
        {
            this.BmpPlayerBullLinkBombList = BmpPlayerBullLinkBombList;
            this.BmpPlayerBullList         = BmpPlayerBullList;
            this.Current_BullStatus        = Current_BullStatus;
            this.Current_BullType          = Current_BullType;
            this.Big_Bull = Big_Bull;

            if (Big_Bull == true)
            {
                Width = 20; Height = 40;
            }
            else
            {
                Width = 10; Height = 20;
            }
            if (this.Current_BullType == status_BullType.LinkBomb)
            {
                Width = 40; Height = 40;
            }
            this.BX  = BX - Width / 2;
            this.EX  = EX;
            this.Y   = Y - Height;
            Distance = Math.Sqrt((BX - EX) * (BX - EX) + Y * Y);
            DX       = EX - BX;
            DY       = Y;
            s_bull   = new Sprite(gd);

            if (Current_BullType == status_BullType.SuperBomb)
            {
                showPicture = new Texture(gd, BmpPlayerBullList[2], 0, Pool.Managed);
            }
            else if (Current_BullType == status_BullType.LinkBomb)
            {
                showPicture = new Texture(gd, BmpPlayerBullLinkBombList[Bomb_Index++], 0, Pool.Managed);
            }
            else
            {
                if (Big_Bull == false)
                {
                    showPicture = new Texture(gd, BmpPlayerBullList[0], 0, Pool.Managed);
                }
                else
                {
                    showPicture = new Texture(gd, BmpPlayerBullList[1], 0, Pool.Managed);
                }
            }
        }
Exemplo n.º 4
0
        public void Draw(Device gd, Sprite s, Texture t)
        {
            if (Current_BullStatus == status_BullStatus.miss)
            {
                return;
            }
            RiseCount++;
            X = BX + (int)(RiseCount * (step * 4 / Distance) * DX);
            Y = Y + (int)(RiseCount * (step / 32 / Distance) * DY);

            position.X = X;
            position.Y = Y;

            s.Begin(SpriteFlags.AlphaBlend);
            for (int j = 0; j < 16; j++)
            {
                for (int i = 0; i < bullcount; i++)
                {
                    if (i <= bullcount / 2 - 1)
                    {//(bullcount/2 - i) *
                        position.X = X - (bullcount / 2 - i) * RiseCount;
                        position.Y = Y - (bullcount / 2 - i) * (bullcount / 2 - i) * RiseCount / 30 + 30;
                    }
                    else if (i >= bullcount / 2 + 1)
                    {//(i - bullcount/2) *
                        position.X = X + (i - bullcount / 2) * RiseCount;
                        position.Y = Y - (i - bullcount / 2) * (i - bullcount / 2) * RiseCount / 30 + 30;
                    }
                    else
                    {
                        position.X = X;
                        position.Y = Y + 30;
                    }

                    s.Draw2D(t, rotationPoint, j * 0.4f, position, Color.White);
                }
            }

            /*position.X = X + RiseCount * RiseCount;
             * position.Y = Y;
             * s.Draw2D(t, rotationPoint, 0, position, Color.White);*/
            s.End();
            if (Y > 600)
            {
                Current_BullStatus = status_BullStatus.miss;
            }
        }
Exemplo n.º 5
0
        public void Draw(Device gd, Sprite s, Texture t)
        {
            if (Current_BullStatus == status_BullStatus.miss)
            {
                return;
            }
            RiseCount++;
            X = BX + (int)(RiseCount * (step * 4 / Distance) * DX);
            Y = Y + (int)(RiseCount * (step / 32 / Distance) * DY);


            position.X = X;
            position.Y = Y;
            s.Begin(SpriteFlags.AlphaBlend);
            s.Draw2D(t, rotationPoint, 0f, position, Color.White);
            s.End();
            if (Y > 600)
            {
                Current_BullStatus = status_BullStatus.miss;
            }
        }
Exemplo n.º 6
0
        public virtual void Draw(Device gd, Sprite s, List <Texture> t, List <Texture> t2)
        {
            if (Current_BullStatus != status_BullStatus.active)
            {
                return;
            }


            RiseCount++;

            if (Current_BullType == status_BullType.SuperBomb)
            {
                X = BX + (int)(RiseCount * (step * 4 / Distance) * DX);
                Y = Y - (int)(RiseCount * (step / 12 / Distance) * DY);
            }
            else if (Current_BullType == status_BullType.Bull)
            {
                X = BX + (int)(RiseCount * (step * 4 / Distance) * DX);
                Y = Y - (int)(RiseCount * (step / Distance) * DY);
            }
            else if (Current_BullType == status_BullType.LinkBomb)
            {
                Bomb_Index %= (BmpPlayerBullLinkBombList.Count);

                X = BX + (int)(RiseCount * (step * 4 / Distance) * DX);
                Y = Y - (int)(RiseCount * (step / 4 / Distance) * DY);
            }


            if (Current_BullType == status_BullType.SuperBomb)
            {
                DrawImage(gd, s, t[2], X - Width / 2 - 2, Y);
            }
            else if (Current_BullType == status_BullType.LinkBomb)
            {
                DrawImage(gd, s, t2[Bomb_Index++], X, Y);
            }
            else
            {
                if (Big_Bull == false)
                {
                    DrawImage(gd, s, t[0], X, Y);
                }
                else
                {
                    DrawImage(gd, s, t[1], X, Y);
                }
            }

            if (Current_BullType == status_BullType.SuperBomb)
            {
                if (Y < 200)
                {
                    Current_BullStatus = status_BullStatus.hit;
                }
            }
            else
            {
                if (Y < 0)
                {
                    Current_BullStatus = status_BullStatus.miss;
                }
            }
        }