diff --git a/src/Scenes/Test.hs b/src/Scenes/Test.hs index d250984..5aae234 100644 --- a/src/Scenes/Test.hs +++ b/src/Scenes/Test.hs @@ -51,18 +51,18 @@ instance Scene Test where onEvents = singleHandler render level = liftIO $ do - (GLAssets va vb ib sh tx) <- atomically (readTMVar $ testGraphics level) + (GLAssets va vb ib sh _) <- atomically (readTMVar $ testGraphics level) (LevelMap layers _ _ tileMap _) <- atomically (readTMVar $ testMap level) stageSet <- readTVarIO (testStageSet level) nonPlayerCast <- readTVarIO (testCast level) - powerups <- (V.map Cast) <$> (readTVarIO (testPowerups level)) - A.logIO A.Debug (fromString $ V.foldl (\acc (Cast p) -> acc ++ show p ++ " ") "" powerups) + powerups <- V.map Cast <$> readTVarIO (testPowerups level) + -- A.logIO A.Debug (fromString $ V.foldl (\acc (Cast p) -> acc ++ show p ++ " ") "" powerups) pituicat <- readTVarIO (testPlayer level) let cast = Cast (fromJust pituicat) `V.cons` powerups V.++ - nonPlayerCast - playerPos@(V2 px py) = realToFrac <$> (pcPos $ fromJust pituicat) + nonPlayerCast + (V2 px py) = realToFrac <$> pcPos (fromJust pituicat) atomically $ modifyTVar (testMatrices level) $ \pvm -> pvm @@ -71,7 +71,7 @@ instance Scene Test where (V3 (400 - px) (300 - py) 0) } - (PVM p v m) <- atomically $ readTVar (testMatrices level) + (PVM p v m) <- readTVarIO (testMatrices level) let (indices, vertices) = populate layers @@ -89,6 +89,6 @@ instance Scene Test where write ib 0 (VS.map fromIntegral indices) bind (tileMapTexture tileMap) - V.mapM_ (\(StageSet p) -> bindPropTexture p) stageSet - V.mapM_ (\(Cast c) -> bindPropTexture c) cast + V.mapM_(\(StageSet prop) -> bindPropTexture prop) stageSet + V.mapM_(\(Cast c) -> bindPropTexture c) cast R.draw va ib sh diff --git a/src/Types/PowerUp.hs b/src/Types/PowerUp.hs index 44671b1..deb1dd3 100644 --- a/src/Types/PowerUp.hs +++ b/src/Types/PowerUp.hs @@ -81,26 +81,23 @@ instance Mass PowerUp where acceleration = puAcc accelerationUpdater o = - (\acc -> o + \acc -> o { puAcc = acc } - ) velocity = puVel velocityUpdater o = - (\vel -> o + \vel -> o { puVel = vel } - ) position = puPos positionUpdater o = - (\pos -> o + \pos -> o { puPos = pos } - ) instance Collidible PowerUp where