Move bullet trajectory into bullet update function

This commit is contained in:
2022-07-17 10:31:34 +01:00
parent c9f7f39f22
commit 7d6407bebc
15 changed files with 159 additions and 121 deletions
+11 -4
View File
@@ -524,8 +524,15 @@ data BeamType
{_beamCombine :: (Point2 , (Point2,Point2,Beam) , (Point2,Point2,Beam)) -> World -> World}
| BeamSimple
data BulletState = NormalBulletState
| DyingBulletState
| DelayedBullet Float
data BulletUpdateMod = NoBulletUpdateMod
data Bullet = Bullet
{ _buUpdate :: World -> Bullet -> (World, Maybe Bullet)
{ _buState :: BulletState
, _buUpdateMod :: BulletUpdateMod
, _buTrajectory :: BulletTrajectory
, _buVel :: Point2
, _buDrag :: Float
, _buPos :: Point2
@@ -645,9 +652,9 @@ type HitEffect' = Bullet
data BulletTrajectory
= BasicBulletTrajectory
| BezierTrajectory
| FlechetteTrajectory
| MagnetTrajectory
| BezierTrajectory Point2 Point2 Point2
| FlechetteTrajectory Point2
| MagnetTrajectory Point2
data AmmoType
= ProjectileAmmo