cat flips in move direction

This commit is contained in:
nek0 2021-04-29 21:02:41 +02:00
parent 865e931a43
commit 58ae21724b

View file

@ -45,28 +45,40 @@ data Pituicat = Pituicat
instance Drawable Pituicat where
toVertices (Pituicat (V2 x y) _ _ _ _ _ _ _ _ _) =
toVertices (Pituicat (V2 x y) _ (V2 mx _) _ _ _ _ _ _ _) =
( V.fromList [0, 1, 2, 2, 3, 0]
, V.fromList
[ newVertex
(V3 (realToFrac x - 25) (realToFrac y - 25) 0)
(V4 1 1 1 1)
(V2 0 (1 - 50 / 1024))
(if mx >= 0
then V2 0 (1 - 50 / 1024)
else V2 (50 / 1024) (1 - 50 / 1024)
)
1
, newVertex
(V3 (realToFrac x + 25) (realToFrac y - 25) 0)
(V4 1 1 1 1)
(V2 (50 / 1024) (1 - 50 / 1024))
( if mx >= 0
then V2 (50 / 1024) (1 - 50 / 1024)
else V2 0 (1 - 50 / 1024)
)
1
, newVertex
(V3 (realToFrac x + 25) (realToFrac y + 25) 0)
(V4 1 1 1 1)
(V2 (50 / 1024) 1)
(if mx >= 0
then V2 (50 / 1024) 1
else V2 0 1
)
1
, newVertex
(V3 (realToFrac x - 25) (realToFrac y + 25) 0)
(V4 1 1 1 1)
(V2 0 1)
(if mx >= 0
then V2 0 1
else V2 (50 / 1024) 1
)
1
]
)