-
Notifications
You must be signed in to change notification settings - Fork 0
/
Types.hs
33 lines (21 loc) · 854 Bytes
/
Types.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{-# LANGUAGE Arrows #-}
{-# LANGUAGE TemplateHaskell #-}
module Types where
import Graphics.Gloss (Point, Vector)
import Control.Lens
import qualified Graphics.Gloss.Interface.IO.Game as G
type InputEvent = G.Event
data MouseClick = Mouse { mPosition :: Point,
mDirection :: Axis }
data Wall = Wall { coord :: Float , axis :: Axis }
data Axis = V | H
data Ball = Ball { _pos :: Point,
_vel :: Vector}
data World = World { _level :: [Ball],
_borders :: [Wall],
_hwalls :: [Wall],
_vwalls :: [Wall],
_ballRad :: Float }
newtype Rotation = Rot {applyRot :: Ball -> Ball}
makeLenses ''Ball
makeLenses ''World