Added configurable weapons.

This commit is contained in:
2026-01-03 21:49:27 -05:00
parent 79fd63c3ce
commit e8e31bb143
37 changed files with 332 additions and 88 deletions

View File

@@ -1,8 +1,11 @@
using AlienAttack.MonoGame.Things.Items;
using AlienAttack.MonoGame.Things.Muzzles;
using Microsoft.Xna.Framework;
using System;
namespace AlienAttack.MonoGame.Things.Bullets;
internal class Bullet(float x, float y, float xVel, float yVel, Sprite owner) : Sprite(x, y)
public class Bullet(float x, float y, float xVel, float yVel, Sprite owner) : Sprite(x, y)
{
protected float XVelocity = xVel;
protected float YVelocity = yVel;
@@ -32,7 +35,9 @@ internal class Bullet(float x, float y, float xVel, float yVel, Sprite owner) :
public override void OnCollision(SpriteCollisionContext context)
{
if (context.Sprite is Bullet || context.Sprite == Owner || context.Sprite is Item)
Sprite sprite = context.Sprite;
if (sprite is Bullet || sprite == Owner || sprite is Item || sprite is Explosion)
return;
IsDead = true;