Added HUD drawing logic.

This commit is contained in:
2025-12-21 23:22:53 -05:00
parent ecdc501752
commit 42608a16e3
11 changed files with 247 additions and 39 deletions

View File

@@ -1,5 +1,4 @@
using AlienAttack.MonoGame.Things.Bullets;
using Microsoft.Xna.Framework;
namespace AlienAttack.MonoGame.Things.Weapons;
@@ -10,13 +9,13 @@ public class Minigun : Weapon
public override void Fire(Sprite owner, SpriteUpdateContext context)
{
// Calculate bullet spawn positions relative to the player's bounding box
int x1 = (int)owner.XPosition + 12;
int x2 = (int)owner.XPosition + owner.BoundBox.Width - 20;
int y = (int)owner.YPosition + 6;
int x1 = (int)owner.XPosition + 14;
int x2 = (int)owner.XPosition + owner.BoundBox.Width - 16;
int y = (int)owner.YPosition + 10;
// Create bullets with velocity (0, -4)
MinigunBulletSmall bullet1 = new(x1, y, 0, -6, owner);
MinigunBulletSmall bullet2 = new(x2, y, 0, -6, owner);
MinigunBulletLarge bullet1 = new(x1, y, 0, -6, owner);
MinigunBulletLarge bullet2 = new(x2, y, 0, -6, owner);
// Queue the bullets for spawning
context.SpawnSprite(bullet1);