Complete stritifying points
This commit is contained in:
+3
-4
@@ -47,10 +47,9 @@ handleEvent' e = case eventPayload e of
|
||||
_ -> Just
|
||||
|
||||
handleMouseMotionEvent :: MouseMotionEventData -> World -> Maybe World
|
||||
handleMouseMotionEvent mmev w = Just $ w & mousePos .~
|
||||
(fromIntegral x - 0.5*getWindowX w
|
||||
,0.5*getWindowY w - fromIntegral y
|
||||
)
|
||||
handleMouseMotionEvent mmev w = Just $ w & mousePos .~ V2
|
||||
(fromIntegral x - 0.5*getWindowX w)
|
||||
(0.5*getWindowY w - fromIntegral y)
|
||||
where
|
||||
P (V2 x y) = mouseMotionEventPos mmev
|
||||
|
||||
|
||||
@@ -99,8 +99,8 @@ escapeMap w = w & carteDisplay .~ False
|
||||
dropLight :: World -> World
|
||||
dropLight w = placeLS ls dec pos 0 w
|
||||
where --(rot, g) = randomR (-pi,pi) $ _randGen w
|
||||
(x,y) = _crPos(you w)
|
||||
pos = (x,y,0)
|
||||
(V2 x y) = _crPos (you w)
|
||||
pos = (V3 x y 0)
|
||||
ls = lightAt pos 0
|
||||
dec = onLayer PtLayer $ color white $ circleSolid 8
|
||||
|
||||
|
||||
+5
-5
@@ -3,7 +3,7 @@ The tree of rooms that make up a level. -}
|
||||
module Dodge.Floor
|
||||
( levx
|
||||
) where
|
||||
--import Geometry
|
||||
import Geometry.Data
|
||||
--import Picture
|
||||
import Dodge.Data
|
||||
--import Dodge.Room
|
||||
@@ -51,9 +51,9 @@ roomTreex = do
|
||||
,[Corridor]
|
||||
,[Corridor]
|
||||
,[SpecificRoom . pure . pure . Right $ roomGlassOctogon 400
|
||||
& rmPS %~ ([sPS (0,50) 0 $ PutCrit armourChaseCrit
|
||||
,sPS (50,25) 0 $ PutCrit armourChaseCrit
|
||||
,sPS (50,0) 0 $ PutCrit armourChaseCrit
|
||||
& rmPS %~ ([sPS (V2 0 50) 0 $ PutCrit armourChaseCrit
|
||||
,sPS (V2 50 25) 0 $ PutCrit armourChaseCrit
|
||||
,sPS (V2 50 0) 0 $ PutCrit armourChaseCrit
|
||||
]++)
|
||||
]
|
||||
--,[Corridor]
|
||||
@@ -61,7 +61,7 @@ roomTreex = do
|
||||
-- & rmPS %~ ([swarmPS 0 (x,y) 0 swarmCrit | x <- [-20,-19.5.. 20] , y <- [200,202] ]++)
|
||||
-- ]
|
||||
,[SpecificRoom . pure . pure . Right $ roomGlassOctogon 400
|
||||
& rmPS %~ ([sPS (0,50) 0 $ PutCrit pistolCrit ]++)
|
||||
& rmPS %~ ([sPS (V2 0 50) 0 $ PutCrit pistolCrit ]++)
|
||||
]
|
||||
,[Corridor]
|
||||
,[Corridor]
|
||||
|
||||
@@ -10,6 +10,7 @@ import Dodge.Story
|
||||
import Dodge.WorldEvent.Cloud
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.SoundLogic.Synonyms
|
||||
import Geometry.Data
|
||||
|
||||
import System.Random
|
||||
import qualified Data.Set as S
|
||||
@@ -26,7 +27,7 @@ firstWorld = do
|
||||
initialWorld :: World
|
||||
initialWorld = defaultWorld
|
||||
{ _keys = S.empty
|
||||
, _cameraCenter = (0,0)
|
||||
, _cameraCenter = (V2 0 0)
|
||||
, _cameraRot = 0
|
||||
, _cameraZoom = 10
|
||||
, _creatures = IM.fromList [(0,startCr)]
|
||||
@@ -35,10 +36,10 @@ initialWorld = defaultWorld
|
||||
, _forceFields = IM.empty
|
||||
, _floorItems = IM.empty
|
||||
, _randGen = mkStdGen 2
|
||||
, _mousePos = (0,0)
|
||||
, _mousePos = (V2 0 0)
|
||||
, _testString = []
|
||||
, _yourID = 0
|
||||
, _worldEvents = soundOncePos foamSprayFadeOutSound (0,0) . foldr ((.) . makeStartCloudAt) id [(x,y) | x <- [-5,-3..5] , y <- [-5,-3..5]]
|
||||
, _worldEvents = soundOncePos foamSprayFadeOutSound (V2 0 0) . foldr ((.) . makeStartCloudAt) id [(V2 x y) | x <- [-5,-3..5] , y <- [-5,-3..5]]
|
||||
, _pressPlates = IM.empty
|
||||
, _buttons = IM.empty
|
||||
, _soundQueue = []
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import Dodge.Room.Data
|
||||
import Dodge.Room.AddTile
|
||||
import Dodge.Default.Wall
|
||||
import Geometry
|
||||
import Geometry.Data
|
||||
--import Geometry.Data
|
||||
import Dodge.Room.Link
|
||||
import qualified IntMapHelp as IM
|
||||
--import Dodge.Debug.LinkDecoration
|
||||
|
||||
+2
-2
@@ -423,7 +423,7 @@ shootersRoom1 = do
|
||||
y3 <- iterateWhile (\y' -> abs (y1 - y2) < 60 && abs (y2 - y') < 60) $ state $ randomR (250,560)
|
||||
x4 <- state $ randomR (60,w-60)
|
||||
y4 <- state $ randomR (40,180)
|
||||
p <- takeOne [(x1,y1-10),(x2,y2-10),(x3,y3-10)]
|
||||
p <- takeOne [(V2 (x1) (y1-10)),(V2 (x2) (y2-10)),(V2 (x3) (y3-10))]
|
||||
let bln x y = putBlockN (x+25) (x-25) (y+10) y
|
||||
let blv x y = putBlockV (x+25) (x-25) (y+10) y
|
||||
let plmnts = bln x1 y1 ++ bln x2 y2 ++ bln x3 y3 ++ blv x4 y4
|
||||
@@ -518,7 +518,7 @@ spawnerRoom = do
|
||||
,wl
|
||||
,sPS (V2 (x/2) ( y-10)) 0 putLamp
|
||||
]
|
||||
let f ((lx,_),_) = lx < x/2-5
|
||||
let f ((V2 lx _),_) = lx < x/2-5
|
||||
roomWithSpawner <- (fmap connectRoom . randomiseOutLinks) =<< filterLinks f (set rmPS plmnts $ roomRect x y 2 2)
|
||||
aRoom <- airlock 0
|
||||
return $ treeFromTrunk [Left aRoom] roomWithSpawner
|
||||
|
||||
+1
-1
@@ -201,7 +201,7 @@ crSpring c w = IM.foldl' (flip $ crCrSpring c) w cs
|
||||
crCrSpring :: Creature -> Creature -> World -> World
|
||||
crCrSpring c1 c2 w
|
||||
| id1 == id2 = w
|
||||
| vec == (0,0) = w
|
||||
| vec == (V2 0 0) = w
|
||||
| diff >= comRad = w
|
||||
| otherwise = over (creatures . ix id1 . crPos) (+.+ overlap1)
|
||||
$ over (creatures . ix id2 . crPos) (-.- overlap2) w
|
||||
|
||||
Reference in New Issue
Block a user