From 58ae21724bd81c24c3d5697b0494868d46af6930 Mon Sep 17 00:00:00 2001 From: nek0 Date: Thu, 29 Apr 2021 21:02:41 +0200 Subject: [PATCH] cat flips in move direction --- src/Types/Player.hs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/Types/Player.hs b/src/Types/Player.hs index ed11554..48f7295 100644 --- a/src/Types/Player.hs +++ b/src/Types/Player.hs @@ -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 ] )