layers-game 0.5.3 → 0.6.0
raw patch · 4 files changed
+28/−27 lines, 4 filesdep ~pretty-show
Dependency ranges changed: pretty-show
Files
- layers-game.cabal +17/−18
- src/FileData/ApplyToEntity.hs +4/−2
- src/FileData/Data1ToData2.hs +3/−3
- src/Main.hs +4/−4
layers-game.cabal view
@@ -1,10 +1,10 @@-name: layers-game-version: 0.5.3 cabal-version: >=1.6-build-type: Simple+name: layers-game+version: 0.6.0 license: BSD3 license-file: LICENSE maintainer: daniel.trstenjak@gmail.com+author: Daniel Trstenjak synopsis: A prototypical 2d platform game. description: /A prototypical 2d platform game/@@ -51,7 +51,7 @@ > button pressed and moving the mouse >mouse wheel = change scale of orthographic projection category: Game-author: Daniel Trstenjak+build-type: Simple data-files: Ressources/Images/*.png Ressources/*.hs@@ -66,21 +66,8 @@ executable layers main-is: Main.hs- build-depends:- base >3 && <5,- mtl >=2.1.3.1 && <2.3,- pretty-show >=1.6.7 && <1.8,- cmdargs >=0.10.7 && <0.11,- data-lens >=2.10.4 && <2.12,- OpenGLRaw >=3.0.0.0 && <3.4,- GLFW-b >=1.0 && <3.3,- ListZipper >=1.2.0.2 && <1.3,- composition >=1.0.1.0 && <1.1,- Gamgine >=0.4 && <0.6 cpp-options: -DCABAL cc-options: -Wno-unused-result- extensions: CPP- include-dirs: src hs-source-dirs: src other-modules: Paths_layers_game@@ -130,5 +117,17 @@ Callback.Key Callback.MouseButton Event+ extensions: CPP+ include-dirs: src ghc-options: -pgmPcpphs -optP--cpp-+ build-depends:+ base >3 && <5,+ mtl >=2.1.3.1 && <2.3,+ pretty-show >=1.6.7 && <1.10,+ cmdargs >=0.10.7 && <0.11,+ data-lens >=2.10.4 && <2.12,+ OpenGLRaw >=3.0.0.0 && <3.4,+ GLFW-b >=1.0 && <3.3,+ ListZipper >=1.2.0.2 && <1.3,+ composition >=1.0.1.0 && <1.1,+ Gamgine >=0.4 && <0.6
src/FileData/ApplyToEntity.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FlexibleInstances #-} module FileData.ApplyToEntity where import FileData.Data2@@ -10,10 +12,10 @@ apply f entity = f entity instance Monoid b => ApplyToEntity Layer b where- apply f (Layer _ entities _) = applyAE f entities+ apply f (Layer entities _) = applyAE f entities instance Monoid b => ApplyToEntity Level b where- apply f (Level _ entities layers) =+ apply f (Level entities layers) = (applyAE f entities) `mappend` (applyAE f layers) instance Monoid b => ApplyToEntity Data b where
src/FileData/Data1ToData2.hs view
@@ -1,5 +1,5 @@ -module Data1ToData2 where+module FileData.Data1ToData2 where import qualified FileData.Data1 as D1 import qualified FileData.Data2 as D2 @@ -10,7 +10,7 @@ writeFile d2Path d1 convert :: D1.Data -> D2.Data-convert data1 = +convert data1 = D2.Data D2.dataVersion (map convertLevel $ D1.levels data1) convertLevel :: D1.Level -> D2.Level@@ -36,6 +36,6 @@ D2.Platform id (convertPos pos) size where convertPos (Right (D1.Moving velo path biDir)) =- Right $ D2.Animation (D1.length velo) path biDir + Right $ D2.Animation (D1.length velo) path biDir convertPos (Left pos) = Left pos
src/Main.hs view
@@ -146,10 +146,10 @@ updateCamera = do (w, h) <- getL AP.windowSizeL (r, t) <- getL AP.frustumSizeL- GL.glViewport 0 0 (fromIntegral w) (fromIntegral h)- GL.glMatrixMode GL.GL_PROJECTION- GL.glLoadIdentity- GL.glOrtho 0 (G.floatToFloat r) 0 (G.floatToFloat t) (-1) 1+ GL.glViewport 0 0 (fromIntegral w) (fromIntegral h)+ GL.glMatrixMode GL.GL_PROJECTION+ GL.glLoadIdentity+ GL.glOrtho 0 (G.floatToFloat r) 0 (G.floatToFloat t) (-1) 1 updateOrthoScale _ _ yoffset = do modL AP.orthoScaleL (+ yoffset)