Esempio n. 1
0
        public RedButterfly(TextureManager texturemanager, float orix, float oriy, float speed = 180)
        {
            this.speed   = speed;
            max_distance = speed * max_percent;
            min_distance = speed * min_percent;
            sprites      = new Sprite[bodycount];
            positions    = new Vector2D[bodycount];
            multiSprites = new MultiSprite[2];
            speeds       = new float[bodycount];
            Texture texture = texturemanager.Get("enemys1");
            float   percent = 1;

            for (int i = 0; i < bodycount; i++)
            {
                percent            = (float)i / (bodycount - 1);
                speeds[i]          = speed - percent * speed * divide_percent;
                percent            = 1 - percent;
                percent           *= percent;
                sprites[i]         = new Sprite();
                sprites[i].Texture = texture;
                sprites[i].SetWidth(percent * 32);
                sprites[i].SetHeight(percent * 32);
                sprites[i].SetUVs(0, 0, 0, 0);
                sprites[i].SetPosition(orix, oriy);
                positions[i] = new Vector2D(orix, oriy);
            }
            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(32);
            sprite.SetPosition(orix, oriy);
            multiSprites[1] = new MultiSprite(sprites);        //身体(球),导入整个数组进入
            multiSprites[1].changeinterval = 0.15f;
            multiSprites[0] = new MultiSprite(sprite);         //头部(蝴蝶)
            multiSprites[0].changeinterval = 0.05f;
            multiSprite = multiSprites[0];

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(16 * per_512 + i * per_512 * 4, 20 * per_512,
                                          16 * per_512 + (i + 1) * 4 * per_512, 24 * per_512);
            }
            multiSprites[0].RegeditState(0, rects);
            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(32 * per_512 + i * per_512 * 4, 20 * per_512,
                                          32 * per_512 + (i + 1) * 4 * per_512, 24 * per_512);
            }
            multiSprites[1].RegeditState(0, rects);
            effect = new StartEffect_Red(Stage1State._textureManager);
        }
Esempio n. 2
0
 public BlueButterfly(TextureManager texturemanager)
 {
     Texture texture = texturemanager.Get("enemys1");
     sprite = new Sprite();
     sprite.Texture = texture;
     sprite.SetWidth(32);
     sprite.SetHeight(32);
     multiSprite = new MultiSprite(sprite);
     multiSprite.changeinterval = 0.15f;
     RecTangleF[] rects = new RecTangleF[4];
     for (int i = 0; i < 4; i++)
     {
         rects[i] = new RecTangleF(16 * per_512 + i * per_512 * 4, 16 * per_512,
             16 * per_512 + (i + 1) * 4 * per_512, 20 * per_512);
     }
     multiSprite.RegeditState(0, rects);
     effect = new StartEffect_Red(Stage1State._textureManager);
 }
Esempio n. 3
0
        public BlueButterfly(TextureManager texturemanager)
        {
            Texture texture = texturemanager.Get("enemys1");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(32);
            multiSprite = new MultiSprite(sprite);
            multiSprite.changeinterval = 0.15f;
            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(16 * per_512 + i * per_512 * 4, 16 * per_512,
                                          16 * per_512 + (i + 1) * 4 * per_512, 20 * per_512);
            }
            multiSprite.RegeditState(0, rects);
            effect = new StartEffect_Red(Stage1State._textureManager);
        }
Esempio n. 4
0
        public RedButterfly(TextureManager texturemanager , float orix , float oriy, float speed =180)
        {
            this.speed = speed;
            max_distance = speed * max_percent;
            min_distance = speed * min_percent;
            sprites = new Sprite[bodycount];
            positions = new Vector2D[bodycount];
            multiSprites = new MultiSprite[2];
            speeds = new float[bodycount];
            Texture texture = texturemanager.Get("enemys1");
            float percent = 1;
            for (int i = 0; i < bodycount; i++)
            {
                percent = (float)i / (bodycount-1);
                speeds[i] = speed - percent * speed * divide_percent;
                 percent = 1 - percent;
                percent *= percent;
                sprites[i] = new Sprite();
                sprites[i].Texture = texture;
                sprites[i].SetWidth(percent *32);
                sprites[i].SetHeight(percent * 32);
                sprites[i].SetUVs(0, 0, 0, 0);
                sprites[i].SetPosition(orix, oriy);
                positions[i] = new Vector2D(orix, oriy);
            }
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(32);
            sprite.SetPosition(orix, oriy);
            multiSprites[1] = new MultiSprite(sprites);        //身体(球),导入整个数组进入
            multiSprites[1].changeinterval = 0.15f;
            multiSprites[0] = new MultiSprite(sprite);         //头部(蝴蝶)
            multiSprites[0].changeinterval = 0.05f;
            multiSprite = multiSprites[0];

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(16*per_512+ i * per_512 * 4, 20*per_512,
                    16 * per_512 + (i + 1) * 4 * per_512, 24 * per_512);
            }
            multiSprites[0].RegeditState(0, rects);
            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(32 * per_512 + i * per_512 * 4, 20 * per_512,
                    32 * per_512 + (i + 1) * 4 * per_512, 24 * per_512);
            }
            multiSprites[1].RegeditState(0, rects);
            effect = new StartEffect_Red(Stage1State._textureManager);
        }