Make background black, start cleanup of weapons

This commit is contained in:
2021-08-26 21:18:46 +01:00
parent cb39ee3e6b
commit c97c16777a
9 changed files with 34 additions and 16 deletions
+1 -1
View File
@@ -2,5 +2,5 @@
out vec4 fColor; out vec4 fColor;
void main() void main()
{ {
fColor = vec4 (0.9,0.5,0,1); fColor = vec4 (0,0,0,1);
} }
+1 -1
View File
@@ -159,7 +159,7 @@ startCr = defaultCreature
startInventory :: IM.IntMap Item startInventory :: IM.IntMap Item
startInventory = IM.fromList (zip [0..20] startInventory = IM.fromList (zip [0..20]
( (
[longGun [ltAutoGun
,autoGun ,autoGun
,hvAutoGun ,hvAutoGun
,pistol ,pistol
+1 -1
View File
@@ -57,7 +57,7 @@ pjTimerF time i = projectiles . ix i . pjUpdate .~ (\_ -> pjTimerF (time - 1) i)
drawDDA :: IM.IntMap IS.IntSet -> Picture drawDDA :: IM.IntMap IS.IntSet -> Picture
drawDDA = setLayer 1 . color (withAlpha 0.5 green) . IM.foldlWithKey' f blank drawDDA = setLayer 1 . color (withAlpha 0.5 green) . IM.foldlWithKey' f blank
where where
f pic x' ys' = (concatMapPic (\y -> polygon (rectNSEW (y+50) y (x+50) x)) ys) `appendPic` pic f pic x' ys' = concatMapPic (\y -> polygon (rectNSEW (y+50) y (x+50) x)) ys `appendPic` pic
where where
x = 50 * fromIntegral x' x = 50 * fromIntegral x'
ys = map ((50 *) . fromIntegral) $ IS.toList ys' ys = map ((50 *) . fromIntegral) $ IS.toList ys'
+6 -2
View File
@@ -291,8 +291,12 @@ ltAutoGun = defaultAutoGun
, _wpReloadState = 0 , _wpReloadState = 0
, _itUseRate = 3 , _itUseRate = 3
, _itUseTime = 0 , _itUseTime = 0
, _itUse = \_ -> shootWithSound 0 . withRandomDir 0.3 . withSidePush 50 , _itUse = \_ -> withSidePush 50 $ withVelWthHiteff (V2 30 0) 2 basicBulletEffect
. withMuzFlare $ withVelWthHiteff (V2 30 0) 2 basicBulletEffect , _itUseModifiers =
[ shootWithSoundI 0
, withRandomDirI 0.3
, withMuzFlareI
]
, _wpSpread = 0.5 , _wpSpread = 0.5
, _wpRange = 20 , _wpRange = 20
, _itFloorPict = onLayer FlItLayer ltAutoGunPic , _itFloorPict = onLayer FlItLayer ltAutoGunPic
+13
View File
@@ -131,6 +131,19 @@ withRecoil recoilAmount eff cr = eff cr . over (creatures . ix cid) pushback
pushback = over crPos (+.+ rotateV (_crDir cr) (V2 ((-recoilAmount) / _crMass cr ) 0)) pushback = over crPos (+.+ rotateV (_crDir cr) (V2 ((-recoilAmount) / _crMass cr ) 0))
{- | Pushes a creature sideways by a random amount. {- | Pushes a creature sideways by a random amount.
Applied before the underlying effect. -} Applied before the underlying effect. -}
withSidePushI
:: Float -- ^ Maximal possible side push amount
-> (Creature -> World -> World)
-- ^ Underlying world effect, takes creature id as input
-> Creature
-> World -> World
withSidePushI maxSide eff cr w = eff cr . over (creatures . ix cid) push $ w
where
cid = _crID cr
push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr)))
(pushAmount, _) = randomR (-maxSide,maxSide) $ _randGen w
{- | Pushes a creature sideways by a random amount.
Applied before the underlying effect. -}
withSidePush withSidePush
:: Float -- ^ Maximal possible side push amount :: Float -- ^ Maximal possible side push amount
-> (Creature -> World -> World) -> (Creature -> World -> World)
+1 -1
View File
@@ -1,4 +1,4 @@
{-# LANGUAGE TupleSections #-} --{-# LANGUAGE TupleSections #-}
{-| {-|
Module : Dodge.LevelGen.StaticWalls Module : Dodge.LevelGen.StaticWalls
Description : Concerns carving out of static walls to create the general room plan of the level. Description : Concerns carving out of static walls to create the general room plan of the level.
+6 -4
View File
@@ -71,15 +71,17 @@ doDrawing pdata w = do
clearColor $= Color4 0 0 0 0 clearColor $= Color4 0 0 0 0
clear [ColorBuffer,DepthBuffer] clear [ColorBuffer,DepthBuffer]
depthFunc $= Just Less depthFunc $= Just Less
if w ^. config . wall_textured
then renderTextureWalls pdata nWalls
else renderBlankWalls pdata nWalls
-- draw wall occlusions from your point of view -- draw wall occlusions from your point of view
drawShader (_lightingOccludeShader pdata) nWalls drawShader (_lightingOccludeShader pdata) nWalls
-- this might only work because the uniform has been correctly set -- this might only work because the uniform has been correctly set
-- elsewhere, beware -- elsewhere, beware
if w ^. config . wall_textured
then renderTextureWalls pdata nWalls
else renderBlankWalls pdata nWalls
renderFoldable shadV $ polysToPic $ foregroundPics w renderFoldable shadV $ polysToPic $ foregroundPics w
layerCounts <- UMV.replicate (6*6) 0 layerCounts <- UMV.replicate (6*6) 0
+1 -2
View File
@@ -308,8 +308,7 @@ weaponBetweenPillars :: RandomGen g => State g (Tree (Either Room Room))
weaponBetweenPillars = do weaponBetweenPillars = do
wpPos <- takeOne [V2 x y | x <- [20,120,220], y <- [20,120,220]] wpPos <- takeOne [V2 x y | x <- [20,120,220], y <- [20,120,220]]
(ps,_) <- takeNMore 2 ([], [V2 x y | x <- [20,220], y <- [20,120,220]]) (ps,_) <- takeNMore 2 ([], [V2 x y | x <- [20,220], y <- [20,120,220]])
let crPos1 = ps !! 0 let crPos1:crPos2:_ = ps
crPos2 = ps !! 1
d p = argV $ V2 120 120 -.- p d p = argV $ V2 120 120 -.- p
plmnts = plmnts =
[sPS wpPos 0 $ RandPS randFirstWeapon [sPS wpPos 0 $ RandPS randFirstWeapon
+4 -4
View File
@@ -20,7 +20,7 @@ sizeFBOs
-> Int -- ^ Full width -> Int -- ^ Full width
-> Int -- ^ Full height -> Int -- ^ Full height
-> RenderData -> RenderData
-> IO (RenderData) -> IO RenderData
sizeFBOs xsize ysize xfull yfull rdata = do sizeFBOs xsize ysize xfull yfull rdata = do
resizeRBO (_rboBaseBloom rdata) xsize ysize resizeRBO (_rboBaseBloom rdata) xsize ysize
resizeRBO (_rboLighting rdata) xsize ysize resizeRBO (_rboLighting rdata) xsize ysize
@@ -44,10 +44,10 @@ updateFBOTO
:: Int :: Int
-> Int -> Int
-> ((TextureFilter, Maybe TextureFilter),TextureFilter) -> ((TextureFilter, Maybe TextureFilter),TextureFilter)
-> GLenum -> GLenum -- ^ internal color format
-> RenderData -> RenderData
-> ALens' RenderData (FramebufferObject, TextureObject) -> ALens' RenderData (FramebufferObject, TextureObject)
-> IO (RenderData) -> IO RenderData
updateFBOTO xsize ysize mmfilt inFormat pdata target = do updateFBOTO xsize ysize mmfilt inFormat pdata target = do
newfbo2 <- resizeFBOTO (pdata ^# target) xsize ysize mmfilt inFormat newfbo2 <- resizeFBOTO (pdata ^# target) xsize ysize mmfilt inFormat
return $ storing target newfbo2 pdata return $ storing target newfbo2 pdata
@@ -57,7 +57,7 @@ resizeFBOTO
-> Int -> Int
-> Int -> Int
-> ((TextureFilter, Maybe TextureFilter),TextureFilter) -> ((TextureFilter, Maybe TextureFilter),TextureFilter)
-> GLenum -> GLenum -- ^ internal color format
-> IO (FramebufferObject, TextureObject) -> IO (FramebufferObject, TextureObject)
resizeFBOTO (fboName,toOld) xsize ysize mmfilt inFormat = do resizeFBOTO (fboName,toOld) xsize ysize mmfilt inFormat = do
bindFramebuffer Framebuffer $= fboName bindFramebuffer Framebuffer $= fboName