Add basic vocalizations to chase creatures

This commit is contained in:
2021-11-18 01:46:37 +00:00
parent 5949ad2b3d
commit f6d5d5a201
34 changed files with 525 additions and 329 deletions
+15
View File
@@ -2,6 +2,9 @@ module Dodge.PlacementSpot where
import Dodge.LevelGen.Data
import Geometry
import Control.Monad.State
import System.Random
-- TODO rename to any unused link facing out
anyLnkOutPS :: PlacementSpot
anyLnkOutPS = PSLnk f (const id) Nothing
@@ -21,3 +24,15 @@ anyLnkInPS x = PSLnk f (const id) Nothing
where
f (UnusedLink v a) = Just $ PS (v -.- x *.* unitVectorAtAngle (a + 0.5 * pi)) (a+ pi)
f _ = Nothing
useLnkRoomPos :: RoomPos -> Maybe PlacementSpot
useLnkRoomPos rp = case rp of
(UnusedLink (V2 x y) a) -> Just $ PS (V2 x y) a
_ -> Nothing
psRandRanges :: (Float,Float) -> (Float,Float) -> (Float,Float) -> State StdGen (Point2,Float)
psRandRanges xranges yranges aranges = do
x <- state $ randomR xranges
y <- state $ randomR yranges
a <- state $ randomR aranges
return (V2 x y,a)