28 lines
866 B
C#
28 lines
866 B
C#
using AlienAttack.MonoGame.Textures;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using System;
|
|
|
|
namespace AlienAttack.MonoGame.Things.Bullets;
|
|
|
|
public class LaserBulletMedium : Bullet
|
|
{
|
|
public const int Width = 7;
|
|
public const int Height = 21;
|
|
|
|
public LaserBulletMedium(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
|
{
|
|
Origin = new(Width / 2, Height / 2);
|
|
BoundBox = new(0, 0, Width, Height);
|
|
Damage = 2;
|
|
}
|
|
|
|
public override void Draw(SpriteDrawArgs args)
|
|
{
|
|
Texture2D texture = args.Textures.Get(TextureNames.Bullets.LaserMedium);
|
|
|
|
float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f;
|
|
|
|
args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, Origin, 1f, SpriteEffects.None, 1);
|
|
}
|
|
} |