Added more sound effects. Added initial weapon muzzle fire logic.
This commit is contained in:
43
AlientAttack.MonoGame/Things/Weapons/FireBulletContext.cs
Normal file
43
AlientAttack.MonoGame/Things/Weapons/FireBulletContext.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using AlienAttack.MonoGame.Things.Bullets;
|
||||
using AlienAttack.MonoGame.Things.Muzzles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Weapons;
|
||||
|
||||
internal record FireBulletContext
|
||||
{
|
||||
public Sprite Owner { get; init; }
|
||||
public SpriteUpdateContext SpriteUpdateContext { get; init; }
|
||||
public int BulletWidth { get; init; }
|
||||
public int BulletHeight { get; init; }
|
||||
public Anchor Anchor { get; init; }
|
||||
public Shot[] Shots { get; init; }
|
||||
public Func<float, float, float, float, Sprite, Bullet> Factory { get; init; }
|
||||
}
|
||||
|
||||
public record Shot
|
||||
{
|
||||
public float OffsetX { get; init; }
|
||||
public float OffsetY { get; init; }
|
||||
public float XVelocity { get; init; }
|
||||
public float YVelocity { get; init; }
|
||||
}
|
||||
|
||||
internal record FireBulletFromMuzzleContext
|
||||
{
|
||||
public Sprite Owner { get; init; }
|
||||
public SpriteUpdateContext SpriteUpdateContext { get; init; }
|
||||
public int BulletWidth { get; init; }
|
||||
public int BulletHeight { get; init; }
|
||||
public MuzzleShot[] Shots { get; init; }
|
||||
public Vector2 ExtraOffset { get; init; } = default;
|
||||
public Func<float, float, float, float, Sprite, Bullet> Factory { get; init; }
|
||||
}
|
||||
|
||||
public record MuzzleShot
|
||||
{
|
||||
public MuzzleId Muzzle { get; init; }
|
||||
public float XVelocity { get; init; }
|
||||
public float YVelocity { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user