Added other bullet classes. Add plasma pickup audio.
This commit is contained in:
17
AlientAttack.MonoGame/Things/Bullets/BulletKind.cs
Normal file
17
AlientAttack.MonoGame/Things/Bullets/BulletKind.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
public enum BulletKind
|
||||
{
|
||||
LaserSmall,
|
||||
LaserMedium,
|
||||
LaserLarge,
|
||||
MinigunSmall,
|
||||
MinigunMedium,
|
||||
MinigunLarge,
|
||||
PlasmaSmall,
|
||||
PlasmaMedium,
|
||||
PlasmaLarge,
|
||||
ProtonSmall,
|
||||
ProtonMedium,
|
||||
ProtonLarge
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/LaserBulletLarge.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/LaserBulletLarge.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class LaserBulletLarge : Bullet
|
||||
{
|
||||
public const int Width = 8;
|
||||
public const int Height = 28;
|
||||
|
||||
public LaserBulletLarge(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 3;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Laser_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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/LaserBulletMedium.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/LaserBulletMedium.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal 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)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 2;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Laser_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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/LaserBulletSmall.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/LaserBulletSmall.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class LaserBulletSmall : Bullet
|
||||
{
|
||||
public const int Width = 6;
|
||||
public const int Height = 18;
|
||||
|
||||
public LaserBulletSmall(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 1;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Laser_Small");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/PlasmaBulletLarge.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/PlasmaBulletLarge.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class PlasmaBulletLarge : Bullet
|
||||
{
|
||||
public const int Width = 9;
|
||||
public const int Height = 31;
|
||||
|
||||
public PlasmaBulletLarge(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 3;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Plasma_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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/PlasmaBulletMedium.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/PlasmaBulletMedium.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class PlasmaBulletMedium : Bullet
|
||||
{
|
||||
public const int Width = 8;
|
||||
public const int Height = 26;
|
||||
|
||||
public PlasmaBulletMedium(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 2;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Plasma_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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/PlasmaBulletSmall.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/PlasmaBulletSmall.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class PlasmaBulletSmall : Bullet
|
||||
{
|
||||
public const int Width = 7;
|
||||
public const int Height = 24;
|
||||
|
||||
public PlasmaBulletSmall(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 1;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Plasma_Small");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/ProtonBulletLarge.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/ProtonBulletLarge.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class ProtonBulletLarge : Bullet
|
||||
{
|
||||
public const int Width = 13;
|
||||
public const int Height = 13;
|
||||
|
||||
public ProtonBulletLarge(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 3;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Proton_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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/ProtonBulletMedium.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/ProtonBulletMedium.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class ProtonBulletMedium : Bullet
|
||||
{
|
||||
public const int Width = 10;
|
||||
public const int Height = 10;
|
||||
|
||||
public ProtonBulletMedium(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 2;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Proton_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);
|
||||
}
|
||||
}
|
||||
27
AlientAttack.MonoGame/Things/Bullets/ProtonBulletSmall.cs
Normal file
27
AlientAttack.MonoGame/Things/Bullets/ProtonBulletSmall.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Bullets;
|
||||
|
||||
internal class ProtonBulletSmall : Bullet
|
||||
{
|
||||
public const int Width = 6;
|
||||
public const int Height = 6;
|
||||
|
||||
public ProtonBulletSmall(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner)
|
||||
{
|
||||
BoundBox = new(0, 0, Width, Height);
|
||||
Damage = 1;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteDrawArgs args)
|
||||
{
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Proton_Small");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user