Added HUD drawing logic.
This commit is contained in:
24
AlientAttack.MonoGame/Things/Bullets/MinigunBulletLarge.cs
Normal file
24
AlientAttack.MonoGame/Things/Bullets/MinigunBulletLarge.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class MinigunBulletLarge : Bullet
|
||||
{
|
||||
public MinigunBulletLarge(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, 9, 27);
|
||||
Damage = 3;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Minigun_Large");
|
||||
|
||||
float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f;
|
||||
Vector2 origin = new(texture.Width / 2f, texture.Height / 2f);
|
||||
|
||||
args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1);
|
||||
}
|
||||
}
|
||||
24
AlientAttack.MonoGame/Things/Bullets/MinigunBulletMedium.cs
Normal file
24
AlientAttack.MonoGame/Things/Bullets/MinigunBulletMedium.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class MinigunBulletMedium : Bullet
|
||||
{
|
||||
public MinigunBulletMedium(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, 11, 21);
|
||||
Damage = 2;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Minigun_Medium");
|
||||
|
||||
float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f;
|
||||
Vector2 origin = new(texture.Width / 2f, texture.Height / 2f);
|
||||
|
||||
args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1);
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,7 @@ internal class MinigunBulletSmall : Bullet
|
||||
{
|
||||
public MinigunBulletSmall(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
XVelocity = xVel;
|
||||
YVelocity = yVel;
|
||||
Owner = owner;
|
||||
BoundBox = new(0, 0, 7, 17);
|
||||
Damage = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user