summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TankBattleCore/Objects/Game.cs9
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(