/// <summary> /// phương thức bắn đạn /// </summary> public void Shot() { if ( dto.CglobalFunc.KeyboardPress(Keys.Space)) { if (dto.TimerAddBullet >= dto.IntevalAddBullet) { dto.TimerAddBullet -= dto.IntevalAddBullet; CBusiBullet b = new CBusiBullet(new CInfoBullet(dto.Game, "bullet_1", new Vector2(dto.Position.X + dto.Animation.Dto.Rectangle.Width / 2, dto.Position.Y), 10, 3, CInfoBullet.Owner.player)); dto.ListBullet.Add(b); dto.CglobalDic.ListSoundEffect["shoot"].Play(); } } }
public void Shot() { if (dto.TimerAddBullet >= dto.IntevalAddBullet && dto.ListBullet.Count <= dto.MaxBullet && dto.Position.X >= 0) { dto.TimerAddBullet -= dto.IntevalAddBullet; CBusiBullet b = new CBusiBullet(new CInfoBullet(dto.Game, "bullet_2", new Vector2(dto.Position.X + 15, dto.Position.Y + 10), 2, 1, CInfoBullet.Owner.enemy)); dto.ListBullet.Add(b); } }