Refactor grenades and rockets to allow different explosions

This commit is contained in:
Ross
2021-03-27 12:56:27 +00:00
parent fb17502781
commit 881359c4ac
3 changed files with 207 additions and 15 deletions
+8
View File
@@ -484,6 +484,14 @@ data Projectile = Projectile { _ptPos :: Point2
, _ptID :: Int
, _ptUpdate :: World -> World
}
| Shell { _ptPos :: Point2
, _ptStartPos :: Point2
, _ptVel :: Point2
, _ptPict :: Picture
, _ptID :: Int
, _ptUpdate :: World -> World
, _ptExplosion :: Point2-> World -> World
}
data DamageType = Piercing {_dmAmount :: Int , _dmFrom :: Point2 , _dmAt :: Point2 , _dmTo :: Point2 }
| Blunt {_dmAmount :: Int , _dmFrom :: Point2 , _dmAt :: Point2 , _dmTo :: Point2 }