protected override IEnumerable <bool> E_Draw() { D2Point speed = GameCommon.GetXYSpeed(this.Direction, 10.0); for (int frame = 0; ; frame++) { this.X += speed.X; this.Y += speed.Y; DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(frame / 2.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 10.0); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))); // カメラの外に出たら(画面から見えなくなったら)消滅する。 } }
protected override IEnumerable <bool> E_Draw() { D2Point speed = GameCommon.GetXYSpeed(this.Direction, 8.0); int bouncedCount = 0; for (int frame = 0; ; frame++) { this.X += speed.X; this.Y += speed.Y; if (this.壁をすり抜ける) // ? 跳ね返り可能 { bool bounced = false; if (this.IsInsideWall(-10, 0) || this.IsInsideWall(10, 0)) { speed.X *= -1.0; bounced = true; } if (this.IsInsideWall(0, -10) || this.IsInsideWall(0, 10)) { speed.Y *= -1.0; bounced = true; } if (bounced) { DDGround.EL.Add(SCommon.Supplier(Effects.跳ねた(this.X, this.Y))); bouncedCount++; if (BOUNCE_MAX <= bouncedCount) { this.壁をすり抜ける = false; } } } DDDraw.DrawBegin(Ground.I.Picture2.IconSet[0, 35], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(frame / 2.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 10.0); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))); // カメラの外に出たら(画面から見えなくなったら)消滅する。 } }
protected override IEnumerable <bool> E_Draw() { double ctrx = this.X; double ctry = this.Y; D2Point speed = GameCommon.GetXYSpeed(this.Direction, 5.5); for (int frame = 0; ; frame++) { ctrx += speed.X; ctry += speed.Y; double xadd = speed.Y * 20.0; double yadd = speed.X * 20.0; if (this.左回転) { xadd *= -1.0; } else { yadd *= -1.0; } double rate = Math.Sin(frame / 20.0); xadd *= rate; yadd *= rate; this.X = ctrx + xadd; this.Y = ctry + yadd; DDDraw.DrawBegin(Ground.I.Picture2.IconSet[2, 35], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(frame / 2.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 10.0); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))); // カメラの外に出たら(画面から見えなくなったら)消滅する。 } }