haskanoid 0.1.5 → 0.1.5.2
raw patch · 8 files changed
+35/−15 lines, 8 filesdep ~basedep ~transformersnew-uploader
Dependency ranges changed: base, transformers
Files
- haskanoid.cabal +12/−8
- src/Constants.hs +1/−1
- src/Data/IdentityList.hs +14/−0
- src/FRP/Extra/Yampa.hs +0/−1
- src/Game.hs +5/−2
- src/Input.hs +1/−1
- src/Physics/TwoDimensions/Collisions.hs +1/−1
- src/Physics/TwoDimensions/Physics.hs +1/−1
haskanoid.cabal view
@@ -1,23 +1,23 @@--- Initial haskanoid.cabal generated by cabal init. For further +-- Initial haskanoid.cabal generated by cabal init. For further -- documentation, see http://haskell.org/cabal/users-guide/ -- The name of the package. name: haskanoid --- The package version. See the Haskell package versioning policy (PVP) +-- The package version. See the Haskell package versioning policy (PVP) -- for standards guiding when and how versions should be incremented. -- http://www.haskell.org/haskellwiki/Package_versioning_policy -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.5+version: 0.1.5.2 -- A short (one-line) description of the package. synopsis: A breakout game written in Yampa using SDL -- A longer description of the package. description: An arkanoid game featuring SDL graphics and sound, and- Wiimote & Kinect support, implemented using Yampa. + Wiimote & Kinect support, implemented using Yampa. -- URL for the project homepage or repository. homepage: http://github.com/ivanperez-keera/haskanoid@@ -31,14 +31,14 @@ -- The package author(s). author: Ivan Perez and Henrik Nilsson --- An email address to which users can send suggestions, bug reports, and +-- An email address to which users can send suggestions, bug reports, and -- patches. maintainer: ivan.perez@keera.co.uk -- A copyright notice. -- copyright: -category: Game+category: Game, Reactivity, FRP build-type: Simple @@ -95,8 +95,8 @@ Resources -- Other library packages from which modules are imported.- build-depends: base > 4.6 && < 5,- transformers >= 0.3 && < 0.5,+ build-depends: base >= 4.6 && < 5,+ transformers >= 0.3 && < 0.6, mtl, MissingH, Yampa >= 0.9.6 && < 0.11,@@ -108,3 +108,7 @@ if flag(kinect) build-depends: freenect, vector++source-repository head+ type: git+ location: git://github.com/ivanperez-keera/haskanoid.git
src/Constants.hs view
@@ -52,7 +52,7 @@ -- Max speed maxVNorm :: Double-maxVNorm = 500+maxVNorm = 300 -- Delays -- restartDelay :: Time
src/Data/IdentityList.hs view
@@ -37,6 +37,20 @@ import Data.List (find) +import Data.Foldable+import Data.Traversable+import Control.Applicative+import Prelude hiding (foldr)++instance Traversable IL where+ traverse f (IL nextK assocs) = pure f' <*> traverse f vals+ where (keys, vals) = unzip assocs+ f' vs = IL nextK (zip keys vs)++instance Foldable IL where+ foldr f b = foldr f b . elemsIL+ foldMap f = foldMap f . elemsIL+ ------------------------------------------------------------------------------ -- Data type definitions
src/FRP/Extra/Yampa.hs view
@@ -2,7 +2,6 @@ import Control.Arrow import FRP.Yampa-import FRP.Yampa.Event -- Auxiliary Yampa stuff
src/Game.hs view
@@ -510,8 +510,11 @@ -- velocity. rec- let v = limitNorm (20.0 *^ (refPosPaddle ci ^-^ p)) maxVNorm+ -- let v = limitNorm (20.0 *^ (refPosPaddle ci ^-^ p)) maxVNorm+ -- let p = refPosPaddle ci -- (initPosPaddle ^+^) ^<< integral -< v+ let v = 100.00 *^ (refPosPaddle ci ^-^ p) p <- (initPosPaddle ^+^) ^<< integral -< v+ -- let p = refPosPaddle ci -- Use this code if you want instantaneous movement, -- particularly cool with the Wiimote, but remember to cap@@ -525,7 +528,7 @@ Object{ objectName = name , objectKind = Paddle (paddleWidth,paddleHeight) , objectPos = p- , objectVel = v+ , objectVel = (0,0) , objectAcc = (0,0) , objectDead = False , objectHit = isHit
src/Input.hs view
@@ -33,6 +33,7 @@ -- External imports import Data.IORef import Graphics.UI.SDL as SDL+import Control.Monad -- External imports (Wiimote) #ifdef wiimote@@ -45,7 +46,6 @@ -- External imports (Kinect) #ifdef kinect import Control.Concurrent-import Control.Monad import Data.Maybe (fromJust) import Data.Vector.Storable (Vector,(!)) import Data.Word
src/Physics/TwoDimensions/Collisions.hs view
@@ -4,7 +4,7 @@ -- between shapes. module Physics.TwoDimensions.Collisions where -import FRP.Yampa as Yampa+import FRP.Yampa.VectorSpace as Yampa import Physics.TwoDimensions.Physics -- * Collision sides
src/Physics/TwoDimensions/Physics.hs view
@@ -4,7 +4,7 @@ -- derivatives. module Physics.TwoDimensions.Physics where -import FRP.Yampa as Yampa+import FRP.Yampa.VectorSpace as Yampa import Physics.TwoDimensions.Dimensions data Shape = Rectangle Pos2D Size2D -- A corner and the whole size