Exemplo n.º 1
0
        float distance2 = 900;      //"是否靠近"玩家的判定距离,【以平方计算】

        //构造函数都需要继承基类构造函数
        public GratePowerPoint(TextureManager texturemanager, float X, float Y)
            : base()
        {
            this.Type = Item.BigP_Point;
            //确定弹射范围
            Position.X    = X; Position.Y = Y;
            OriPosition   = new Vector2D(Position.X, Position.Y);
            breakPosition = new Vector2D(Direction.X * breakLength + Position.X, Direction.Y * breakLength + Position.Y);

            //正常状态
            Texture texture = texturemanager.Get("Ef_etama2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetHeight(16);
            sprite.SetWidth(16);
            sprite.SetUVs(4 * per_256, 8 * per_256, 6 * per_256, 10 * per_256);

            //顶部状态(三角形形态)
            Texture texture2 = texturemanager.Get("Ef_etama2");

            littleState         = new Sprite();
            littleState.Texture = texture2;
            littleState.SetWidth(16);
            littleState.SetHeight(16);
            littleState.SetUVs(20 * per_256, 8 * per_256, 22 * per_256, 10 * per_256);
        }
Exemplo n.º 2
0
        public TestSpriteClassSate(TextureManager textureManager)
        {
            _textureManager     = textureManager;              //接手纹理管理器
            _testSprite.Texture = _textureManager.Get("Font"); //设定精灵的纹理
            _testSprite.SetHeight(256 * 0.5f);                 //不知什么原因,不能从纹理处获取图片的高度
                                                               //而宽度在帮顶纹理时就能够获得
            _testSprite2.Texture = _textureManager.Get("charactor1");
            //  _testSprite2.SetPosition(0, 100);
            _testSprite2.SetColor(new Color(1, 1, 1, 0.9f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite2.SetHeight(128);

            _testSprite3.Texture = _textureManager.Get("Font");
            int g = _testSprite3.Texture.ID;

            _testSprite3.SetColor(new Color(1, 1, 1, 0.7f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite3.SetHeight(128);

            _testSprite4.Texture = _textureManager.Get("mbit1");
            _testSprite4.SetColor(new Color(1, 1, 1, 0.5f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite4.SetHeight(128);

            _testSprite5.Texture = _textureManager.Get("mbit1");
            _testSprite5.SetColor(new Color(1, 1, 1, 0.3f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite5.SetHeight(128);
        }
Exemplo n.º 3
0
        //构造函数都需要继承基类构造函数
        public HelpPoint(TextureManager texturemanager, double X, double Y)
            : base()
        {
            this.Type = Item.Help_Point;
            //确定弹射范围
            Position.X    = X; Position.Y = Y;
            OriPosition   = new Vector2D(Position.X, Position.Y);
            breakPosition = new Vector2D(Direction.X * breakLength + Position.X, Direction.Y * breakLength + Position.Y);
            //正常状态
            Texture texture = texturemanager.Get("Ef_etama2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetHeight(16);
            sprite.SetWidth(16);
            sprite.SetUVs(10 * per_256, 8 * per_256, 12 * per_256, 10 * per_256);

            //顶部状态(三角形形态)
            Texture texture2 = texturemanager.Get("Ef_etama2");

            littleState         = new Sprite();
            littleState.Texture = texture2;
            littleState.SetWidth(16);
            littleState.SetHeight(16);
            littleState.SetUVs(28 * per_256, 8 * per_256, 30 * per_256, 10 * per_256);
        }
Exemplo n.º 4
0
 void init()
 {
     Textures    = new Texture[5];
     Textures[0] = texturemanager.Get("FontAciP1");
     Textures[1] = texturemanager.Get("FontAciP2");
     Textures[2] = texturemanager.Get("FontAciP3");
     Textures[3] = texturemanager.Get("FontAciP4");
     Textures[4] = texturemanager.Get("FontAciP5");
     sprite      = new Sprite();
     sprite.SetWidth(24);
     sprite.SetHeight(24);
     LoadData();
     inited = true;
 }
Exemplo n.º 5
0
        private float distance = 3;         //节点间的间隔距离

        public Blue_Ray(TextureManager _t, Vector2D position, Vector2D direction = null, bool goright = true)
        {
            right     = goright;
            Direction = new Vector2D(0, -1);
            speed     = 100;
            Texture texture = _t.Get("Rays");

            this.Position = position;        //头坐标
            if (direction != null)
            {
                this.Direction = direction;
            }
            Sprite sp;

            for (int i = 0; i < dividecount; i++)
            {
                //切分为dividecount块
                positions.Add(new Vector2D(position.X, position.Y));
                sp         = new Sprite();
                sp.Texture = texture;
                sp.SetUVs(i / dividecount, per_256 * 16, (i + 1) / dividecount, per_256 * 18);
                sp.SetWidth(256 / dividecount * 1.5f);
                sp.SetHeight(16 / 2);
                Rays_sprites.Add(sp);
            }
            radius = 8;
        }
Exemplo n.º 6
0
        float speed2 = 200; //靠近玩家时自动靠近的速度

        #endregion Fields

        #region Constructors

        //构造函数都需要继承基类构造函数
        public BoomPoint(TextureManager texturemanager, float X, float Y)
            : base()
        {
            this.Type = Item.Boom_Point;
            //确定弹射范围
            Position.X = X; Position.Y = Y;
            OriPosition = new Vector2D(Position.X, Position.Y);
            breakPosition = new Vector2D(Direction.X * breakLength + Position.X, Direction.Y * breakLength + Position.Y);

            //正常状态
            Texture texture = texturemanager.Get("Ef_etama2");
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetHeight(16);
            sprite.SetWidth(16);
            sprite.SetUVs(6*per_256, 8 * per_256, 8 * per_256, 10 * per_256);

            //顶部状态(三角形形态)
            Texture texture2 = texturemanager.Get("Ef_etama2");
            littleState = new Sprite();
            littleState.Texture = texture2;
            littleState.SetWidth(16);
            littleState.SetHeight(16);
            littleState.SetUVs(22 * per_256, 8 * per_256, 24 * per_256, 10 * per_256);
        }
Exemplo n.º 7
0
        public ReiMu(TextureManager texturemanager)
        {
            this.texturemanager = texturemanager;
            name = "ReiMu";
            Texture texture = texturemanager.Get("Player2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(48);
            sprite.SetColor(new Color(1, 1, 1, 0.2f));

            multiSprite = new MultiSprite(sprite);

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(0 + i * 4 * per_256, 0, 4 * per_256 + i * 4 * per_256, 6 * per_256);
            }
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
            {
                rects[i] = new RecTangleF(i * 4 * per_256, 6 * per_256,
                                          4 * per_256 + i * 4 * per_256, 12 * per_256);
            }
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state (过渡移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(12 * per_256 + i * 4 * per_256, 6 * per_256,
                                          12 * per_256 + 4 * per_256 + i * 4 * per_256, 12 * per_256);
            }
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state (移动)

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
            {
                rects[i] = new RecTangleF(4 * per_256 + i * 4 * per_256, 6 * per_256,
                                          i * 4 * per_256, 12 * per_256);
            }
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state (过渡移动,右)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(12 * per_256 + 4 * per_256 + i * 4 * per_256, 6 * per_256,
                                          12 * per_256 + i * 4 * per_256, 12 * per_256);
            }
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state (移动)

            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State = 0;                   //将状态切换为3号state

            InitComponents();
        }
Exemplo n.º 8
0
        Vector2D direction = new Vector2D(); //运动方向

        public MissPoint(TextureManager texturemanager, double X, double Y, Vector2D dir, int score = 100)
        {
            //确定类型
            this.Type = Item.Miss_Point;
            working   = true;

            //确定弹射范围
            Position.X = X; Position.Y = Y;
            if (dir.Y < 0)
            {
                dir.Y = -dir.Y;
            }
            if (dir.X >= 0)
            {
                double rad = dir.GetAngle();
                if (rad > 60)
                {
                    rad = 60;
                }
                direction = new Vector2D(0, 1);
                direction.rotate((float)(Datas.LooselyRandom.NextDouble() * (rad - 2 * randDomain) + randDomain));
            }
            else
            {
                double rad = dir.GetAngle();
                rad = 360 - rad;
                if (rad > 60)
                {
                    rad = 60;
                }
                direction = new Vector2D(0, 1);
                direction.rotate(-((float)(Datas.LooselyRandom.NextDouble() * (rad - 2 * randDomain) + randDomain)));
            }

            speed_right = speed_totle * direction.X;
            speed_up    = speed_totle * direction.Y;

            double offset_x = Center_Distance * direction.X;
            double offset_y = Center_Distance * direction.Y;

            Position.X += offset_x;
            Position.Y += offset_y;

            offset_x    = Datas.LooselyRandom.NextDouble() * 2 * randFireDomain - randFireDomain;
            Position.X += offset_x;

            Texture texture = texturemanager.Get("Ef_etama2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetHeight(16);
            sprite.SetWidth(16);
            sprite.SetUVs(14 * per_256, 8 * per_256, 16 * per_256, 10 * per_256);

            //保存了MissPoint的一些必要信息
            ItemData = new itemdata.MissPoint(score, 3);
        }
Exemplo n.º 9
0
 public RedBox(TextureManager t)
 {
     name           = "BlueBox";
     sprite         = new Sprite();
     sprite.Texture = t.Get("Player2");
     sprite.SetHeight(16);
     sprite.SetWidth(16);
     sprite.SetUVs(per_256, 6, 18, 8, 20);
 }
Exemplo n.º 10
0
 public BlueBox(TextureManager t)
 {
     name           = "BlueBox";
     sprite         = new Sprite();
     sprite.Texture = t.Get("Player2");
     sprite.SetHeight(32);
     sprite.SetWidth(32);
     sprite.SetUVs(0, 22 * per_256, 4 * per_256, 26 * per_256);
 }
Exemplo n.º 11
0
 public BlueBox(TextureManager t)
 {
     name = "BlueBox";
     sprite= new Sprite();
      sprite.Texture = t.Get("Player2");
      sprite.SetHeight(32);
      sprite.SetWidth(32);
      sprite.SetUVs(0, 22 * per_256, 4 * per_256, 26 * per_256);
 }
Exemplo n.º 12
0
 public RedBox(TextureManager t)
 {
     name = "BlueBox";
     sprite= new Sprite();
      sprite.Texture = t.Get("Player2");
      sprite.SetHeight(16);
      sprite.SetWidth(16);
      sprite.SetUVs(per_256,6,18,8,20);
 }
Exemplo n.º 13
0
        public Yukari(TextureManager texturemanager)
        {
            name = "YuKaRi";
            Texture texture = texturemanager.Get("Player2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(48);

            multiSprite = new MultiSprite(sprite);

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(4 * 4 * per_256 + i * 4 * per_256, 0,
                                          4 * 4 * per_256 + 4 * per_256 + i * 4 * per_256, 6 * per_256);
            }
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
            {
                rects[i] = new RecTangleF(i * 4 * per_256, 12 * per_256,
                                          4 * per_256 + i * 4 * per_256, 18 * per_256);
            }
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state (过渡移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(12 * per_256 + i * 4 * per_256, 12 * per_256,
                                          12 * per_256 + 4 * per_256 + i * 4 * per_256, 18 * per_256);
            }
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state (移动)

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
            {
                rects[i] = new RecTangleF(4 * per_256 + i * 4 * per_256, 12 * per_256,
                                          i * 4 * per_256, 18 * per_256);
            }
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state (过渡移动,右)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(12 * per_256 + 4 * per_256 + i * 4 * per_256, 12 * per_256,
                                          12 * per_256 + i * 4 * per_256, 18 * per_256);
            }
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state (移动)

            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State = 0;                   //将状态切换为0号state
        }
Exemplo n.º 14
0
        public Wriggle(TextureManager texturemanager)
        {
            name = "Wriggle";
            Texture texture = texturemanager.Get("Wriggle");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(42);
            sprite.SetColor(new Color(1, 1, 1, 0.2f));

            multiSprite = new MultiSprite(sprite);

            float offset = 0.01f;

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            }
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            }
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state (过渡移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            }
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state (移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            }
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state (过渡移动,右)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            }
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state (移动)

            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State = 0;                   //将状态切换为3号state

            InitComponents();
        }
Exemplo n.º 15
0
        public DarkBlueLittleSprite(TextureManager texturemanager)
        {
            name = "DarkBlueLittleSprite";
            Texture texture = texturemanager.Get("enemy");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(32);
            multiSprite = new MultiSprite(sprite);

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 4 * per_512, 0,
                                          (i + 1) * 4 * per_512, 4 * per_512);
            }
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state ,表示正面状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 4 * per_512, 4 * per_512,
                                          (i + 1) * 4 * per_512, 8 * per_512);
            }
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state ,表示右侧渐动的状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF(i * 4 * per_512, 8 * per_512,
                                          (i + 1) * 4 * per_512, 12 * per_512);
            }
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state ,表示右侧移动状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF((i + 1) * 4 * per_512, 4 * per_512,
                                          i * 4 * per_512, 8 * per_512);
            }
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state ,表示左侧渐动的状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
            {
                rects[i] = new RecTangleF((i + 1) * 4 * per_512, 8 * per_512,
                                          i * 4 * per_512, 12 * per_512);
            }
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state ,表示左侧移动状态
            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State          = 0;          //将状态切换为0号state
            multiSprite.changeinterval = 0.1f;
        }
Exemplo n.º 16
0
        public BlueKnife(TextureManager _t)
        {
            Texture texture = _t.Get("etama1");

            name           = "blueknife";
            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(32);
            sprite.SetUVs(0, 18 * per_256, 4 * per_256, 22 * per_256);
        }
Exemplo n.º 17
0
        void initialize()
        {
            //正常状态
            Texture texture = texturemanager.Get("Ef_etama2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetHeight(16);
            sprite.SetWidth(16);
            sprite.SetUVs(2.1f * per_256, 8 * per_256, 3.9f * per_256, 10 * per_256);

            //顶部状态(三角形形态)
            Texture texture2 = texturemanager.Get("Ef_etama2");

            littleState         = new Sprite();
            littleState.Texture = texture2;
            littleState.SetWidth(16);
            littleState.SetHeight(16);
            littleState.SetUVs(18 * per_256, 8 * per_256, 20 * per_256, 10 * per_256);
        }
Exemplo n.º 18
0
        float width_max = 64; //最大宽度

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 爆炸特效
        /// </summary>
        /// <param name="texturemanager">纹理管理器</param>
        /// <param name="pos">绑定对象上的坐标组件</param>
        /// <param name="live_time">存活时间</param>
        /// <param name="min_r">特效半径最小大小</param>
        /// <param name="max_r">特效半径最大大小</param>
        public BreakOut_Blue(TextureManager texturemanager,Vector2D pos,int live_time = 15,float min_r=32,float max_r=64)
        {
            Pos_BindObject = pos;
            living_time = live_time;
            Texture texture = texturemanager.Get("Ef_etama2");
            sprite = new Sprite();
            sprite.Texture = texture;
            width = min_r; height = min_r;
            width_max = max_r; height_max = max_r;
            sprite.SetUVs(24 * per_256, 22 * per_256, 32 * per_256, 30 * per_256);
        }
Exemplo n.º 19
0
        public DrawSpriteState(TextureManager textureManager)
        {
            _textureManager = textureManager;

            Texture texture = _textureManager.Get("huiye");
            height = 128;
            width = 128;

            halfheight = height / 2;
            halfwidth = width / 2;
        }
Exemplo n.º 20
0
        public DrawSpriteState(TextureManager textureManager)
        {
            _textureManager = textureManager;

            Texture texture = _textureManager.Get("huiye");

            height = 128;
            width  = 128;

            halfheight = height / 2;
            halfwidth  = width / 2;
        }
Exemplo n.º 21
0
        public void Render()
        {
            Gl.glShadeModel(Gl.GL_SMOOTH);
            Texture texture = _textureManager.Get("lura");

            Gl.glEnable(Gl.GL_TEXTURE_2D);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture.ID);
            height = 128;
            width  = 128;

            halfheight = height / 2;
            halfwidth  = width / 2;
            Gl.glBegin(Gl.GL_TRIANGLES);
            {
                Gl.glTexCoord2d(0, 0);
                Gl.glVertex3d(x - halfwidth, y + halfheight, z); //top left
                Gl.glTexCoord2d(1, 0);
                Gl.glVertex3d(x + halfwidth, y + halfheight, z);
                Gl.glTexCoord2d(0, 1);
                Gl.glVertex3d(x - halfwidth, y - halfheight, z);

                Gl.glTexCoord2d(1, 0);
                Gl.glVertex3d(x + halfwidth, y + halfheight, z);
                Gl.glTexCoord2d(1, 1);
                Gl.glVertex3d(x + halfwidth, y - halfheight, z);
                Gl.glTexCoord2d(0, 1);
                Gl.glVertex3d(x - halfwidth, y - halfheight, z);
            }
            Gl.glEnd();

            //texture = _textureManager.Get("charactor1");
            //Gl.glEnable(Gl.GL_TEXTURE_2D);
            //Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture.ID);
            //Gl.glEnable(Gl.GL_BLEND);
            //Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA); //这样便能使用透明化(带有alpha值的)
            //Gl.glBegin(Gl.GL_TRIANGLES);
            //{
            //    Gl.glTexCoord2d(0, 0);
            //    Gl.glVertex3d(x - halfwidth, y + halfheight, z); //top left
            //    Gl.glTexCoord2d(1, 0);
            //    Gl.glVertex3d(x + halfwidth, y + halfheight, z);
            //    Gl.glTexCoord2d(0, 1);
            //    Gl.glVertex3d(x - halfwidth, y - halfheight, z);

            //    Gl.glTexCoord2d(1, 0);
            //    Gl.glVertex3d(x + halfwidth, y + halfheight, z);
            //    Gl.glTexCoord2d(1, 1);
            //    Gl.glVertex3d(x + halfwidth, y - halfheight, z);
            //    Gl.glTexCoord2d(0, 1);
            //    Gl.glVertex3d(x - halfwidth, y - halfheight, z);
            //}
            //Gl.glEnd();
        }
Exemplo n.º 22
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);
        }
Exemplo n.º 23
0
        void CreateSprites()
        {
            Texture texture = texturemanager.Get("fontex");

            foreach (Charactor c in charactors)
            {
                Sprite spt = new Sprite();
                spt.Texture = texture;
                spt.SetUVs(c.x * per_256, c.y * per_256, (c.x + 2) * per_256, (c.y + 2) * per_256);
                Font_Sprites.Add(c.id, spt);
            }
        }
Exemplo n.º 24
0
        public TextTestState(TextureManager textureManager)
        {
            _text.Texture = textureManager.Get("Font");
            _textFont     = new TextFont(textureManager);
            spr           = _textFont.GetAci("终");
            spr.SetPosition(-50, 50);
            spr.SetHeight(14); spr.SetWidth(14);

            _text.SetUVs(new Point(0.0547f * 2, 0.0547f), new Point(0.0547f * 3, 0.0547f * 2));
            _text.SetWidth(14);
            _text.SetHeight(14);
        }
Exemplo n.º 25
0
        Vector2D Pos_BindObject;              //绑定对象上的坐标组件

        /// <summary>
        /// 爆炸特效
        /// </summary>
        /// <param name="texturemanager">纹理管理器</param>
        /// <param name="pos">绑定对象上的坐标组件</param>
        /// <param name="live_time">存活时间</param>
        /// <param name="min_r">特效半径最小大小</param>
        /// <param name="max_r">特效半径最大大小</param>
        public BreakOut_Blue(TextureManager texturemanager, Vector2D pos, int live_time = 15, float min_r = 32, float max_r = 64)
        {
            Pos_BindObject = pos;
            living_time    = live_time;
            Texture texture = texturemanager.Get("Ef_etama2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            width          = min_r; height = min_r;
            width_max      = max_r; height_max = max_r;
            sprite.SetUVs(24 * per_256, 22 * per_256, 32 * per_256, 30 * per_256);
        }
Exemplo n.º 26
0
        public TextTestState(TextureManager textureManager)
        {
            _text.Texture = textureManager.Get("Font");
            _textFont = new TextFont(textureManager);
            spr = _textFont.GetAci("终");
            spr.SetPosition(-50, 50);
            spr.SetHeight(14);spr.SetWidth(14);

            _text.SetUVs(new Point(0.0547f*2, 0.0547f), new Point(0.0547f * 3, 0.0547f * 2));
            _text.SetWidth(14);
            _text.SetHeight(14);
        }
Exemplo n.º 27
0
        void CreateSprites()
        {
            Texture texture = _textureManager.Get("Font");

            foreach (Charactor c in charactors)
            {
                Sprite spt = new Sprite();
                spt.Texture = texture;
                spt.SetUVs(new Point(0.05467f * c.x, 0.05467f * c.y),
                           new Point(0.05467f * c.x + 0.05467f, 0.05467f * c.y + 0.05467f));
                Font_Sprites.Add(c.id, spt);
            }
        }
Exemplo n.º 28
0
        public RedCard(TextureManager _t)
        {
            Texture texture = _t.Get("Player2");

            name           = "RedCard";
            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(72);
            sprite.SetHeight(16);
            sprite.SetUVs(2 * per_256, 18 * per_256, 11 * per_256, 20 * per_256);
            sprite.SetColorUp(new Color(1, 1, 1, 0.5f));
            sprite.SetColorDown(new Color(1, 1, 1, 0.5f));
        }
Exemplo n.º 29
0
        public AboutLura(TextureManager textureManager, SoundManagerEx sd)
        {
            _textureManager = textureManager;
            soundmanager    = sd;

            _testSprite.Texture = _textureManager.Get("lura1");
            _testSprite.SetWidth(512);
            _testSprite.SetHeight(512);

            _testSprite.SetPosition(new Vector(0, 0, 0));

            // soundmanager.Play("rj");
        }
Exemplo n.º 30
0
 public BlueCard(TextureManager _t)
 {
     Texture texture;
     texture = _t.Get("Player2");
     name = "BlueCard";
     sprite = new Sprite();
     sprite.Texture = texture;
     sprite.SetWidth(16);
     sprite.SetHeight(16);
     sprite.SetUVs(4 * per_256, 22 * per_256, 6 * per_256, 24 * per_256);
     sprite.SetColorUp(new Color(1, 1, 1, 0.5f));
     sprite.SetColorDown(new Color(1, 1, 1, 0.5f));
 }
Exemplo n.º 31
0
        public AboutLura(TextureManager textureManager , SoundManagerEx sd)
        {
            _textureManager = textureManager;
            soundmanager = sd;

            _testSprite.Texture = _textureManager.Get("lura1");
            _testSprite.SetWidth(512);
            _testSprite.SetHeight(512);

            _testSprite.SetPosition(new Vector(0, 0, 0));

               // soundmanager.Play("rj");
        }
Exemplo n.º 32
0
        public BlueCard(TextureManager _t)
        {
            Texture texture;

            texture        = _t.Get("Player2");
            name           = "BlueCard";
            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(16);
            sprite.SetHeight(16);
            sprite.SetUVs(4 * per_256, 22 * per_256, 6 * per_256, 24 * per_256);
            sprite.SetColorUp(new Color(1, 1, 1, 0.5f));
            sprite.SetColorDown(new Color(1, 1, 1, 0.5f));
        }
Exemplo n.º 33
0
        //允许绑定position,也可以不绑定(不绑定则需要自己指定坐标)
        public StartEffect_Blue(TextureManager texturemanager, Vector2D position = null)
        {
            Texture texture = texturemanager.Get("etama2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(64);
            sprite.SetHeight(64);
            sprite.SetUVs(16 * per_256, 14 * per_256, 24 * per_256, 22 * per_256);
            if (position != null)
            {
                Position = position;
            }
        }
Exemplo n.º 34
0
        //允许绑定position,也可以不绑定(不绑定则需要自己指定坐标)
        public NormalSlowEffect(TextureManager texturemanager, Vector2D position = null)
        {
            Texture texture = texturemanager.Get("Ef_etama2");

            sprite         = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(64);
            sprite.SetHeight(64);
            sprite.SetUVs(0, 14 * per_256, 8 * per_256, 22 * per_256);
            if (position != null)
            {
                Position = position;
            }
        }
Exemplo n.º 35
0
        public TestSpriteClassSate(TextureManager textureManager)
        {
            _textureManager = textureManager;                    //接手纹理管理器
            _testSprite.Texture = _textureManager.Get("Font");   //设定精灵的纹理
            _testSprite.SetHeight(256 * 0.5f);           //不知什么原因,不能从纹理处获取图片的高度
                                                         //而宽度在帮顶纹理时就能够获得
            _testSprite2.Texture = _textureManager.Get("charactor1");
              //  _testSprite2.SetPosition(0, 100);
            _testSprite2.SetColor(new Color(1, 1, 1, 0.9f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite2.SetHeight(128);

            _testSprite3.Texture = _textureManager.Get("Font");
            int g = _testSprite3.Texture.ID;
            _testSprite3.SetColor(new Color(1, 1, 1, 0.7f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite3.SetHeight(128);

            _testSprite4.Texture = _textureManager.Get("mbit1");
            _testSprite4.SetColor(new Color(1, 1, 1, 0.5f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite4.SetHeight(128);

            _testSprite5.Texture = _textureManager.Get("mbit1");
            _testSprite5.SetColor(new Color(1, 1, 1, 0.3f));// Alpha值会影响图片整个的透明度,非常实用,可以实现图像渐变的效果
            _testSprite5.SetHeight(128);
        }
Exemplo n.º 36
0
        public Score_Number(TextureManager _t)
        {
            texturemanager = _t;
            NumberDic      = new Dictionary <string, Sprite>();
            Texture texture = _t.Get("fontex");

            for (int i = 0; i < 10; i++)
            {
                Sprite sp = new Sprite();
                sp.Texture = texture;
                sp.SetWidth(8);
                sp.SetHeight(8);
                sp.SetUVs(i * per_256, 0, (i + 1) * per_256, per_256);
                NumberDic.Add(i.ToString(), sp);
            }
        }
Exemplo n.º 37
0
        public DrakBlueSprite(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[2];
            for (int i = 0; i < 2; i++)
            {
                rects[i] = new RecTangleF(i * per_512 * 4, 0, (i + 1) * 4 * per_512, 4 * per_512);
            }
            multiSprite.RegeditState(0, rects);
        }
Exemplo n.º 38
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);
 }
Exemplo n.º 39
0
        public DarkBlueLittleSprite(TextureManager texturemanager)
        {
            name = "DarkBlueLittleSprite";
            Texture texture = texturemanager.Get("enemy");
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(32);
            multiSprite = new MultiSprite(sprite);

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 4 * per_512 , 0,
                    (i + 1) * 4 * per_512, 4 * per_512);
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state ,表示正面状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 4 * per_512, 4 * per_512,
                    (i + 1) * 4 * per_512, 8 * per_512);
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state ,表示右侧渐动的状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 4 * per_512, 8 * per_512,
                    (i + 1) * 4 * per_512, 12 * per_512);
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state ,表示右侧移动状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF((i + 1) * 4 * per_512, 4 * per_512,
                    i * 4 * per_512, 8 * per_512);
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state ,表示左侧渐动的状态

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF((i + 1) * 4 * per_512, 8 * per_512,
                    i * 4 * per_512, 12 * per_512);
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state ,表示左侧移动状态
            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State = 0;                   //将状态切换为0号state
            multiSprite.changeinterval = 0.1f;
        }
Exemplo n.º 40
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);
        }
Exemplo n.º 41
0
        public Stage1State(StateSystem system, TextureManager texturemanager, SoundManagerEx soundmanager, Form1 form = null)
        {
            _system         = system;
            _textureManager = texturemanager;
            _soundmanager   = soundmanager;
            if (form != null)
            {
                this.form = form;
            }

            GamePlayer          = new Player();
            Datas.CurrentPlayer = GamePlayer;

            gameview = new GameView(texturemanager, soundmanager, 5, GamePlayer);         //中间层着色,注册角色
            GamePlayer.RegisteredRCharactors(Datas.Charactors[Datas.Fore_People_Select],
                                             Datas.Charactors[Datas.Fore_People_Select]); //  Form1.Charactors[Datas.Back_People_Select]);
            GamePlayer.Position.Y  = 30;
            GamePlayer.RenderSpeed = 0.075f;                                              //人物帧动画渲染速度

            foretable = new ForeTable(texturemanager, 10);                                //最前层着色

            foretable.HighScores   = 0;
            foretable.Power        = 0;
            foretable.Graze        = 0;
            foretable.CurrentPoint = 0;
            foretable.LevelPoint   = 1550;
            foretable.CurrentTims  = 0;
            foretable.TotleTims    = 6400;
            foretable.GameLevel    = 1;

            Logo         = new Sprite();
            Logo.Texture = texturemanager.Get("logo1");
            Logo.SetWidth(192);
            Logo.SetHeight(192);
            Logo.SetPosition(210, -130);

            test = new Extra.VariableSprite();
            test.BindSprite(Logo);
            test.SetAttribute(210, -130, 0, 192, 192);

            fonc       = new FontAciHuaKang(texturemanager);
            TextWriter = new FontWriterTool(fonc);
        }
Exemplo n.º 42
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);
        }
Exemplo n.º 43
0
 //允许绑定position,也可以不绑定(不绑定则需要自己指定坐标)
 public NormalSlowEffect(TextureManager texturemanager , Vector2D position = null)
 {
     Texture texture = texturemanager.Get("Ef_etama2");
     sprite = new Sprite();
     sprite.Texture = texture;
     sprite.SetWidth(64);
     sprite.SetHeight(64);
     sprite.SetUVs(0, 14 * per_256, 8 * per_256, 22 * per_256);
     if( position!= null)
      Position = position;
 }
Exemplo n.º 44
0
 //允许绑定position,也可以不绑定(不绑定则需要自己指定坐标)
 public StartEffect_Red(TextureManager texturemanager, Vector2D position = null)
 {
     Texture texture = texturemanager.Get("etama2");
     sprite = new Sprite();
     sprite.Texture = texture;
     sprite.SetWidth(64);
     sprite.SetHeight(64);
     sprite.SetUVs(16 * per_256, 14 * per_256, 24 * per_256, 22 * per_256);
     if (position != null)
         Position = position;
 }
Exemplo n.º 45
0
 public DrakBlueSprite(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[2];
     for (int i = 0; i < 2; i++)
     {
         rects[i] = new RecTangleF(i * per_512 * 4, 0, (i + 1) * 4 * per_512, 4 * per_512);
     }
     multiSprite.RegeditState(0, rects);
 }
Exemplo n.º 46
0
        public Yukari(TextureManager texturemanager)
        {
            name = "YuKaRi";
            Texture texture = texturemanager.Get("Player2");
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(48);

            multiSprite = new MultiSprite(sprite);

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(4 * 4 * per_256 + i * 4 * per_256, 0,
                    4 * 4 * per_256 + 4 * per_256 + i * 4 * per_256, 6 * per_256);
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
                rects[i] = new RecTangleF(i * 4 * per_256, 12 * per_256,
                    4 * per_256 + i * 4 * per_256, 18 * per_256);
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state (过渡移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(12 * per_256 + i * 4 * per_256, 12 * per_256,
                   12 * per_256 + 4 * per_256 + i * 4 * per_256, 18 * per_256);
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state (移动)

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
                rects[i] = new RecTangleF(4 * per_256 + i * 4 * per_256, 12 * per_256,
                   i * 4 * per_256, 18 * per_256);
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state (过渡移动,右)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(12 * per_256 + 4 * per_256 + i * 4 * per_256, 12 * per_256,
                12 * per_256 + i * 4 * per_256, 18 * per_256);
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state (移动)

            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State = 0;                   //将状态切换为0号state
        }
Exemplo n.º 47
0
        public ReiMu(TextureManager texturemanager)
        {
            this.texturemanager = texturemanager;
            name = "ReiMu";
            Texture texture = texturemanager.Get("Player2");
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(48);
            sprite.SetColor(new Color(1, 1, 1, 0.2f));

            multiSprite = new MultiSprite(sprite);

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(0 + i * 4 * per_256, 0, 4 * per_256 + i * 4 * per_256, 6 * per_256);
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
                rects[i] = new RecTangleF(i * 4 * per_256, 6 * per_256,
                    4 * per_256 + i * 4 * per_256, 12 * per_256);
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state (过渡移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(12 * per_256 + i * 4 * per_256, 6 * per_256,
                   12 * per_256 + 4 * per_256 + i * 4 * per_256, 12 * per_256);
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state (移动)

            rects = new RecTangleF[3];
            for (int i = 0; i < 3; i++)
                rects[i] = new RecTangleF(4 * per_256 + i * 4 * per_256, 6 * per_256,
                   i * 4 * per_256, 12 * per_256);
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state (过渡移动,右)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(12 * per_256 + 4 * per_256 + i * 4 * per_256, 6 * per_256,
                12 * per_256 + i * 4 * per_256, 12 * per_256);
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state (移动)

            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State = 0;                   //将状态切换为3号state

            InitComponents();
        }
Exemplo n.º 48
0
        StateSystem _system; // 状态机

        #endregion Fields

        #region Constructors

        public Stage1State(StateSystem system , TextureManager texturemanager , SoundManagerEx soundmanager ,Form1 form = null)
        {
            _system = system;
            _textureManager = texturemanager;
            _soundmanager = soundmanager;
            if(form != null)
            this.form = form;

            GamePlayer = new Player();
            Datas.CurrentPlayer = GamePlayer;

            gameview = new GameView(texturemanager, soundmanager, 5 , GamePlayer); //中间层着色,注册角色
            GamePlayer.RegisteredRCharactors(Datas.Charactors[Datas.Fore_People_Select],
              Datas.Charactors[Datas.Fore_People_Select]);//  Form1.Charactors[Datas.Back_People_Select]);
            GamePlayer.Position.Y = 30;
            GamePlayer.RenderSpeed = 0.075f;                            //人物帧动画渲染速度

            foretable = new ForeTable(texturemanager, 10);          //最前层着色

            foretable.HighScores = 0;
            foretable.Power = 0;
            foretable.Graze = 0;
            foretable.CurrentPoint = 0;
            foretable.LevelPoint = 1550;
            foretable.CurrentTims = 0;
            foretable.TotleTims = 6400;
            foretable.GameLevel = 1;

            Logo = new Sprite();
            Logo.Texture = texturemanager.Get("logo1");
            Logo.SetWidth(192);
            Logo.SetHeight(192);
            Logo.SetPosition(210, -130);

            test = new Extra.VariableSprite();
            test.BindSprite(Logo);
            test.SetAttribute(210, -130, 0, 192, 192);

            fonc = new FontAciHuaKang(texturemanager);
            TextWriter = new FontWriterTool(fonc);
        }
Exemplo n.º 49
0
        public MissPoint(TextureManager texturemanager, double X, double Y,Vector2D dir,int score = 100)
        {
            //确定类型
            this.Type = Item.Miss_Point;
            working = true;

            //确定弹射范围
            Position.X = X; Position.Y = Y;
            if (dir.Y < 0)
                dir.Y = -dir.Y;
            if (dir.X >= 0)
            {
                double rad = dir.GetAngle();
                if (rad > 60)
                    rad = 60;
                direction = new Vector2D(0, 1);
                direction.rotate((float)(Datas.LooselyRandom.NextDouble() * (rad - 2*randDomain) + randDomain));
            }
            else
            {
                double rad = dir.GetAngle();
                rad = 360 - rad;
                if (rad > 60)
                    rad = 60;
                direction = new Vector2D(0, 1);
                direction.rotate(-((float)(Datas.LooselyRandom.NextDouble() * (rad - 2 * randDomain) + randDomain)));
            }

            speed_right = speed_totle * direction.X;
            speed_up = speed_totle * direction.Y;

            double offset_x = Center_Distance * direction.X;
            double offset_y = Center_Distance * direction.Y;
            Position.X += offset_x;
            Position.Y += offset_y;

            offset_x = Datas.LooselyRandom.NextDouble() * 2 *randFireDomain - randFireDomain;
            Position.X += offset_x;

            Texture texture = texturemanager.Get("Ef_etama2");
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetHeight(16);
            sprite.SetWidth(16);
            sprite.SetUVs(14 * per_256, 8 * per_256, 16 * per_256, 10 * per_256);

            //保存了MissPoint的一些必要信息
            ItemData = new itemdata.MissPoint(score,3);
        }
Exemplo n.º 50
0
        //构造函数都需要继承基类构造函数
        public GratePowerPoint(TextureManager texturemanager, double X, double Y)
            : base()
        {
            this.Type = Item.BigP_Point;
            //确定弹射范围
            Position.X = X; Position.Y = Y;
            OriPosition = new Vector2D(Position.X, Position.Y);
            breakPosition = new Vector2D(Direction.X * breakLength + Position.X, Direction.Y * breakLength + Position.Y);

            //正常状态
            Texture texture = texturemanager.Get("Ef_etama2");
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetHeight(16);
            sprite.SetWidth(16);
            sprite.SetUVs(4.1f * per_256, 8 * per_256, 6 * per_256, 9.9f * per_256);

            //顶部状态(三角形形态)
            Texture texture2 = texturemanager.Get("Ef_etama2");
            littleState = new Sprite();
            littleState.Texture = texture2;
            littleState.SetWidth(16);
            littleState.SetHeight(16);
            littleState.SetUVs(20 * per_256, 8 * per_256, 22 * per_256, 10 * per_256);
        }
Exemplo n.º 51
0
 public Score_Number(TextureManager _t)
 {
     texturemanager = _t;
     NumberDic = new Dictionary<string, Sprite>();
     Texture texture = _t.Get("fontex");
     for (int i = 0; i < 10; i++)
     {
         Sprite sp = new Sprite();
         sp.Texture = texture;
         sp.SetWidth(8);
         sp.SetHeight(8);
         sp.SetUVs(i * per_256, 0, (i + 1) * per_256, per_256);
         NumberDic.Add(i.ToString(), sp);
     }
 }
Exemplo n.º 52
0
 public Blue_Ray(TextureManager _t , Vector2D position , Vector2D direction = null, bool goright = true)
 {
     right = goright;
     Direction = new Vector2D(0, -1);
     speed = 100;
     Texture texture = _t.Get("Rays");
     this.Position = position;        //头坐标
     if (direction != null)
         this.Direction = direction;
      Sprite sp;
      for (int i = 0; i < dividecount; i++)
     {
         //切分为dividecount块
         positions.Add(new Vector2D(position.X, position.Y ));
         sp = new Sprite();
         sp.Texture = texture;
         sp.SetUVs(i / dividecount, per_256 *16, (i + 1) / dividecount, per_256 * 18);
         sp.SetWidth(256/dividecount*1.5f);
         sp.SetHeight(16/2);
         Rays_sprites.Add(sp);
     }
      radius = 8;
 }
Exemplo n.º 53
0
 public RedCard(TextureManager _t)
 {
     Texture texture = _t.Get("Player2");
     name = "RedCard";
     sprite = new Sprite();
     sprite.Texture = texture;
     sprite.SetWidth(72);
     sprite.SetHeight(16);
     sprite.SetUVs(2*per_256, 18 * per_256, 11 * per_256, 20 * per_256);
     sprite.SetColorUp(new Color(1,1,1,0.5f));
     sprite.SetColorDown(new Color(1, 1, 1, 0.5f));
 }
Exemplo n.º 54
0
        public Wriggle(TextureManager texturemanager)
        {
            name = "Wriggle";
            Texture texture = texturemanager.Get("Wriggle");
            sprite = new Sprite();
            sprite.Texture = texture;
            sprite.SetWidth(32);
            sprite.SetHeight(42);
            sprite.SetColor(new Color(1, 1, 1, 0.2f));

            multiSprite = new MultiSprite(sprite);

            float offset = 0.01f;

            RecTangleF[] rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            multiSprite.RegeditState(0, rects);      //将此rectangleF注册到0号state

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            multiSprite.RegeditState(1, rects);      //将此rectangleF注册到1号state (过渡移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            multiSprite.RegeditState(2, rects);      //将此rectangleF注册到2号state (移动)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            multiSprite.RegeditState(3, rects);      //将此rectangleF注册到3号state (过渡移动,右)

            rects = new RecTangleF[4];
            for (int i = 0; i < 4; i++)
                rects[i] = new RecTangleF(i * 8 * per_256, per_256, (i + 1) * 8 * per_256 - offset, 13 * per_256);
            multiSprite.RegeditState(4, rects);      //将此rectangleF注册到4号state (移动)

            multiSprite.RegeditCollection(1, 2);     //将1号动画连接到2号动画上
            multiSprite.RegeditCollection(3, 4);     //将3号动画连接到4号动画上
            multiSprite.State = 0;                   //将状态切换为3号state

            InitComponents();
        }
Exemplo n.º 55
0
 public BlueKnife(TextureManager _t)
 {
     Texture texture = _t.Get("etama1");
     name = "blueknife";
     sprite = new Sprite();
     sprite.Texture = texture;
     sprite.SetWidth(32);
     sprite.SetHeight(32);
     sprite.SetUVs(0, 18 * per_256, 4 * per_256, 22 * per_256);
 }