public new MapElementBase AddTo(MapBase map) { Map = map; map.AddElement(this); map.AddElement(Trigger); return this; }
public override void Update(MapBase map) { if (GameTimer.Loop(100) == 0 || Input.Instance.Z) { var rand = new Random(); //var bullet = new BossBullet(new Point(Point.X + rand.Next(-100, 100), Point.Y + rand.Next(-100, 100))); var bullet = new BossBullet(new Point(Top.X-16, Top.Y + rand.Next(96))); if (life != maxlife) { map.AddElement(bullet); } map.UpdateElement(); } //Size = new Size(Math.Abs((int)(baseSize.Width * Math.Sin(GameTimer.Frame / 50.0))), Math.Abs((int)(baseSize.Height * Math.Sin(GameTimer.Frame / 50.0)))); //Top = basePoint + new Size((baseSize.Width - Size.Width)/2, (baseSize.Height - Size.Height)/2); base.Update(map); }
public override void Update(MapBase map) { // 銃 if (Input.Instance.Z) { if (_bulletIntervalCount <= 0) { Bullet bullet; if (Direction == Direction.Right) { bullet = new Bullet(new Point(Point.X + 11, Point.Y + 7), Direction); } else { bullet = new Bullet(new Point(Point.X - 11, Point.Y + 7), Direction); } map.AddElement(bullet); map.UpdateElement(); _bulletIntervalCount = BULLETINTERVAL; } } if (_bulletIntervalCount > 0) { _bulletIntervalCount--; } // ジャンプ if (Input.Instance.LeftShift) { if (jumpflame != 0) { if (jumpflame < 20) { if (jumpflame == 1) { SoundManager.Play("jump", DX.DX_PLAYTYPE_BACK); } jumpflame++; _vy = -8; } else { jumpflame = 0; } } } else { jumpflame = 0; } // 移動 ay = 5; ax = 0; if (Input.Instance.Right) { Direction = Direction.Right; ax += 5; } if (Input.Instance.Left) { Direction = Direction.Left; ax -= 5; } if (!Input.Instance.Right && !Input.Instance.Left) { _vx = 0; } if (movingFloor != null) { Top = new Point(Top.X + movingFloor.Distance.X * 2, Top.Y + movingFloor.Distance.Y * 2); movingFloor = null; } // 状態 if (Top.Y > 600) { Death(); } if (Vy < 0) { MainCharactorStatus = MainCharactorStatus.Jump; } else if (Vy > 5) { MainCharactorStatus = MainCharactorStatus.Fall; } // 更新 base.Update(map); Distance = new Point(Vx, Vy); }