Added configurable weapons.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user