Exemple #1
0
        public override void Render(Renderer renderer)
        {
            //x,y是头的坐标位置,(以下是画出身体)
            float ag = 0;

            for (int i = bodycount - 1; i > 0; i--)
            {
                sprites[i].SetPosition(positions[i].X, positions[i].Y);
                //方向定义为指向前一个块
                Vector2D vct = new Vector2D(positions[i].X - positions[i - 1].X,
                                            positions[i].Y - positions[i - 1].Y);
                //如果点没有发生变化,则跳过本次循环
                if (vct.X == 0 && vct.Y == 0)
                {
                    continue;
                }
                vct.Normalize();
                ag = vct.getcurve();
                renderer.DrawSprite(sprites[i], positions[i].X, positions[i].Y, ag + 90);
            }
        }
Exemple #2
0
        public override void Render()
        {
            //for (int i = 1; i < dividecount; i++)
            //{
            //    Rays_sprites[i].SetPosition(positions[i].X, positions[i].Y);
            //    //方向定义为指向前一个块
            //    Vector2D vct = new Vector2D(positions[i].X - positions[i - 1].X,
            //        positions[i].Y - positions[i - 1].Y);
            //    vct.Normalize();
            //    ag = vct.getcurve();
            //    Stage1State._renderer.DrawSprite(Rays_sprites[i], positions[i].X, positions[i].Y, ag + 90);
            //}
            float ag = 0;

            for (int i = ((int)dividecount - 1); i > 0; i--)
            {
                Rays_sprites[i].SetPosition(positions[i].X, positions[i].Y);
                //方向定义为指向前一个块
                Vector2D vct = new Vector2D(positions[i].X - positions[i - 1].X,
                                            positions[i].Y - positions[i - 1].Y);
                //如果点没有发生变化,则跳过本次循环
                if (vct.X == 0 && vct.Y == 0)
                {
                    continue;
                }
                vct.Normalize();
                ag = vct.getcurve();
                double x = positions[i].X;
                double y = positions[i].Y;
                if (x < 200 && x > -200 && y > -10 && y < 450)
                {
                    Stage1State._renderer.DrawSprite(Rays_sprites[i], (float)positions[i].X, (float)positions[i].Y, ag + 90);
                }
            }

            ag = Direction.getcurve();
            Rays_sprites[0].SetPosition(positions[0].X, positions[0].Y);
            Stage1State._renderer.DrawSprite(Rays_sprites[0], (float)positions[0].X, (float)positions[0].Y, ag - 90);
        }
Exemple #3
0
        public override void Render()
        {
            //for (int i = 1; i < dividecount; i++)
            //{
            //    Rays_sprites[i].SetPosition(positions[i].X, positions[i].Y);
            //    //方向定义为指向前一个块
            //    Vector2D vct = new Vector2D(positions[i].X - positions[i - 1].X,
            //        positions[i].Y - positions[i - 1].Y);
            //    vct.Normalize();
            //    ag = vct.getcurve();
            //    Stage1State._renderer.DrawSprite(Rays_sprites[i], positions[i].X, positions[i].Y, ag + 90);
            //}
            float ag = 0;
            for (int i = ((int)dividecount-1); i > 0; i--)
            {
                Rays_sprites[i].SetPosition(positions[i].X, positions[i].Y);
                //方向定义为指向前一个块
                Vector2D vct = new Vector2D(positions[i].X - positions[i - 1].X,
                    positions[i].Y - positions[i - 1].Y);
                //如果点没有发生变化,则跳过本次循环
                if (vct.X == 0 && vct.Y == 0)
                    continue;
                vct.Normalize();
                ag = vct.getcurve();
                double x = positions[i].X;
                double y = positions[i].Y;
                if (x < 200 && x > -200 && y > -10 && y < 450)
                    Stage1State._renderer.DrawSprite(Rays_sprites[i], (float)positions[i].X, (float)positions[i].Y, ag + 90);
            }

            ag = Direction.getcurve();
            Rays_sprites[0].SetPosition(positions[0].X, positions[0].Y);
            Stage1State._renderer.DrawSprite(Rays_sprites[0], (float)positions[0].X, (float)positions[0].Y, ag - 90);
        }
Exemple #4
0
 public override void Render(Renderer renderer)
 {
     //x,y是头的坐标位置,(以下是画出身体)
     float ag = 0;
     for (int i = bodycount-1; i > 0; i--)
     {
         sprites[i].SetPosition(positions[i].X, positions[i].Y);
         //方向定义为指向前一个块
         Vector2D vct = new Vector2D(positions[i].X - positions[i - 1].X,
             positions[i].Y - positions[i - 1].Y);
         //如果点没有发生变化,则跳过本次循环
         if (vct.X == 0 && vct.Y == 0)
             continue;
         vct.Normalize();
         ag = vct.getcurve();
         renderer.DrawSprite(sprites[i], positions[i].X, positions[i].Y, ag + 90);
     }
 }