速度つき画像表示クラス
상속: PictureObject
예제 #1
0
파일: LifeGage.cs 프로젝트: KHCmaster/PPD
 protected override void UpdateImpl()
 {
     for (int i = onpus.Count - 1; i >= 0; i--)
     {
         OnpuObject onpu = onpus[i];
         onpu.Position = new SharpDX.Vector2(onpu.Position.X + onpu.VelX, onpu.Position.Y);
         onpu.Alpha    = (black.Position.X - onpu.Position.X) / (black.Width - black.Rectangle.Width);
         if (onpu.Alpha <= 0)
         {
             onpuSprite.RemoveChild(onpus[i]);
             onpus.RemoveAt(i);
         }
     }
 }
예제 #2
0
파일: LifeGage.cs 프로젝트: KHCmaster/PPD
        public void CreateOnpu(int num)
        {
            var r = new Random();

            for (int i = 0; i < num; i++)
            {
                var po    = new OnpuObject(device, resourceManager, Utility.Path.Combine("lifegage", "onpu", String.Format("{0}.png", r.Next(1, 6))), 5 + i * 3, 12, true);
                var scale = (float)(r.NextDouble() / 2 + 0.5);
                po.Scale = new Vector2(scale, scale);
                var rotation = (float)((r.NextDouble() - 0.5) * Math.PI / 8);
                po.Rotation = rotation;
                po.VelX     = (float)((r.NextDouble() + 0.5) * 2);
                onpus.Add(po);
                onpuSprite.AddChild(po);
            }
        }