Add targeting reticule for bezier gun
This commit is contained in:
@@ -11,6 +11,7 @@ import Dodge.Item.Weapon.UseEffect
|
||||
--import Dodge.Item.Attachment.Data
|
||||
import Dodge.WorldEvent.Flash
|
||||
import Dodge.WorldEvent.ThingsHit
|
||||
import Dodge.Picture.Layer
|
||||
import Picture
|
||||
import Geometry.Vector
|
||||
|
||||
@@ -115,9 +116,16 @@ rbSetTarget = ItInvEffect
|
||||
|
||||
targetCurrentMousePos
|
||||
:: World
|
||||
-> (World -> Maybe Point2, Item -> Int -> Creature -> World -> Picture)
|
||||
targetCurrentMousePos w = (f, \_ _ _ _ -> cursorPic)
|
||||
-> (World -> Maybe Point2, Int -> Item -> Creature -> World -> Picture)
|
||||
targetCurrentMousePos w = (f, \_ _ _ w' -> cursorPic w')
|
||||
where
|
||||
f _ = Just mwp
|
||||
mwp = mouseWorldPos w
|
||||
cursorPic = line [mwp +.+ (5,5), mwp -.- (5,5)]
|
||||
cursorPic w' = setLayer 1 $ onLayer InvLayer $ uncurry translate mwp
|
||||
$ rotate (_cameraRot w')
|
||||
$ pictures
|
||||
[line [( x,x), (-x,-x)]
|
||||
,line [(-x,x), ( x,-x)]
|
||||
]
|
||||
where
|
||||
x = 5 / _cameraZoom w'
|
||||
|
||||
Reference in New Issue
Block a user