diff options
| author | BoredGuy <osome3717@gmail.com> | 2026-03-28 11:26:25 +0300 |
|---|---|---|
| committer | BoredGuy <osome3717@gmail.com> | 2026-03-28 11:26:25 +0300 |
| commit | 0ac53687ec7df5ceab0a8851088b5e8728e3df06 (patch) | |
| tree | 5bfa18945be3c156954f7595ff9f104dfcde9cf7 | |
| parent | 25fdc90968a14ffd44dae65d6fdb3d50e6df9082 (diff) | |
| -rw-r--r-- | TankBattleCore/Objects/Game.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/TankBattleCore/Objects/Game.cs b/TankBattleCore/Objects/Game.cs index 75f25e5..dbd7042 100644 --- a/TankBattleCore/Objects/Game.cs +++ b/TankBattleCore/Objects/Game.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; -using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using TankBattleCore; using TankBattleCore.Objects; +namespace TankBattleCore.Objects; + internal class GameScene : IScene { private const int PlayAreaOffset = 100; @@ -51,9 +52,9 @@ internal class GameScene : IScene { t.Update(dt); - if (keyboardState.IsKeyDown(Keys.Enter)) + if (keyboardState.IsKeyDown(Keys.Enter) && t.CanShoot()) { - ShootBullet(t.GetNextShot()); + AddBullet(t.ShootBullet()); } } @@ -92,7 +93,7 @@ internal class GameScene : IScene bullets.Add(bullet); } - public void ShootBullet(BulletData bulletData) + public void AddBullet(BulletData bulletData) { AddBullet( new Bullet( |
