-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-0.1.6'. Refs #108.
- Loading branch information
Showing
30 changed files
with
1,279 additions
and
980 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
2023-04-08 Ivan Perez <[email protected]>: | ||
* Version bump (0.1.6) (#108). | ||
* Simplify travis file (#58). | ||
* Update GHC versions, condition, publication in travis (#77). | ||
* Update to support Yampa 0.13 (#82). | ||
* Update pointer to hands-on file (#85). | ||
* Add support for bearriver (#95). | ||
* Support stopping the game with letter q (#99). | ||
* Update installation instructions (#102). | ||
* Bump version bounds of Yampa/bearriver (#104). | ||
* Update dist in travis config file to Bionic (#105). | ||
* Update GHC versions in travis config file (#106). | ||
* Enable CI builds of branches used by our development process (#107). | ||
* Conform to style guide (#103). | ||
|
||
2017-11-02 Ivan Perez <[email protected]>: | ||
* Version bump (0.1.5.4). | ||
* Adds new levels. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
-- | A layer of abstraction on top of SDL audio. | ||
-- | | ||
-- Copyright : (c) Keera Studios, 2010-2014. | ||
-- License : See LICENSE file. | ||
-- Maintainer : Ivan Perez <[email protected]> | ||
-- | ||
-- A layer of abstraction on top of SDL audio. | ||
-- | ||
-- It plays audio soundfx asynchronously (in a new thread), which means that | ||
-- programs must be compiled with the threaded Runtime System (ghc flag is | ||
-- -threaded). | ||
-- | ||
-- This module is 2010-2014 (c) Keera Studios, redistributed with permission. | ||
module Audio | ||
(Music(..), | ||
Audio(..), | ||
initAudio, | ||
loadAudio, | ||
loadMusic, | ||
playMusic, | ||
playFile, | ||
stopMusic, | ||
musicPlaying) where | ||
( Music(..) | ||
, Audio(..) | ||
, initAudio | ||
, loadAudio | ||
, loadMusic | ||
, playMusic | ||
, playFile | ||
, stopMusic | ||
, musicPlaying | ||
) | ||
where | ||
|
||
import Control.Applicative ((<$>)) | ||
import Control.Monad | ||
import Control.Concurrent | ||
import qualified Graphics.UI.SDL.Mixer.General as SDL.Mixer | ||
-- External imports | ||
import Control.Applicative ((<$>)) | ||
import Control.Concurrent | ||
import Control.Monad | ||
import qualified Graphics.UI.SDL.Mixer.Channels as SDL.Mixer.Channels | ||
import qualified Graphics.UI.SDL.Mixer.Music as SDL.Mixer.Music | ||
import qualified Graphics.UI.SDL.Mixer.Types as SDL.Mixer.Types | ||
import qualified Graphics.UI.SDL.Mixer.Samples as SDL.Mixer.Samples | ||
import qualified Graphics.UI.SDL.Mixer.General as SDL.Mixer | ||
import qualified Graphics.UI.SDL.Mixer.Music as SDL.Mixer.Music | ||
import qualified Graphics.UI.SDL.Mixer.Samples as SDL.Mixer.Samples | ||
import qualified Graphics.UI.SDL.Mixer.Types as SDL.Mixer.Types | ||
|
||
data Music = Music { musicName :: String, unMusic :: SDL.Mixer.Types.Music } | ||
|
||
data Audio = Audio { audioName :: String, unAudio :: SDL.Mixer.Types.Chunk } | ||
|
||
-- | Initialize the audio subsystem. | ||
|
@@ -63,6 +70,6 @@ loadAudio fp = fmap (Audio fp) <$> SDL.Mixer.Samples.tryLoadWAV fp | |
-- This function spawns a new OS thread. Remember to compile your program | ||
-- with the threaded RTS. | ||
playFile :: Audio -> Int -> IO () | ||
playFile wav t = void $ forkOS $ do | ||
playFile wav t = void $ forkOS $ do | ||
_v <- SDL.Mixer.Channels.playChannel (-1) (unAudio wav) 0 | ||
threadDelay (t * 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
-- | | ||
-- Copyright : (c) Ivan Perez & Henrik Nilsson, 2014. | ||
-- License : See LICENSE file. | ||
-- Maintainer : Ivan Perez <[email protected]> | ||
-- | ||
-- Game constants. | ||
module Constants where | ||
|
||
-- External imports | ||
import FRP.Yampa | ||
|
||
-- Internal imports | ||
import Physics.TwoDimensions.Dimensions | ||
|
||
width :: Double | ||
width = 640 | ||
width = 640 | ||
|
||
height :: Double | ||
height = 600 | ||
|
||
gameTop :: Double | ||
gameTop = 100 | ||
gameLeft :: Double | ||
gameLeft = 0 | ||
gameTop :: Double | ||
gameTop = 100 | ||
|
||
gameLeft :: Double | ||
gameLeft = 0 | ||
|
||
gameWidth :: Double | ||
gameWidth = width | ||
|
||
gameHeight :: Double | ||
gameHeight = height - gameTop | ||
|
||
|
@@ -24,20 +36,27 @@ loadingDelay = 2 -- seconds | |
paddleWidth, paddleHeight :: Double | ||
paddleWidth = 104 | ||
paddleHeight = 24 | ||
|
||
paddleMargin :: Double | ||
paddleMargin = 50 | ||
|
||
ballWidth, ballHeight :: Double | ||
ballWidth = 10 | ||
ballHeight = 10 | ||
ballWidth = 10 | ||
ballHeight = 10 | ||
|
||
ballMargin :: Double | ||
ballMargin = 30 | ||
ballMargin = 30 | ||
|
||
blockWidth, blockHeight :: Double | ||
blockWidth = 64 | ||
blockHeight = 32 | ||
blockWidth = 64 | ||
blockHeight = 32 | ||
|
||
blockSeparation :: Double | ||
blockSeparation = 10 | ||
|
||
maxBlockLife :: Int | ||
maxBlockLife = 3 | ||
|
||
minBlockLife :: Int | ||
minBlockLife = 1 | ||
|
||
|
@@ -57,13 +76,6 @@ velTrans = 0.2 | |
-- Max speed | ||
maxVNorm :: Double | ||
maxVNorm = 300 | ||
|
||
-- Delays | ||
-- restartDelay :: Time | ||
-- restartDelay = 3 | ||
-- | ||
-- wonDelay :: Time | ||
-- wonDelay = 3 | ||
|
||
-- * Debugging | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
-- | | ||
-- Copyright : (c) Ivan Perez & Henrik Nilsson, 2014. | ||
-- License : See LICENSE file. | ||
-- Maintainer : Ivan Perez <[email protected]> | ||
-- | ||
-- Auxiliary functions related to Control.Monad. | ||
module Control.Extra.Monad where | ||
|
||
-- External imports | ||
import Control.Monad | ||
|
||
whileLoopM :: Monad m => m a -> (a -> Bool) -> (a -> m ()) -> m () | ||
whileLoopM val cond act = r' | ||
where r' = do v <- val | ||
when (cond v) $ do | ||
act v | ||
whileLoopM val cond act | ||
where | ||
r' = do v <- val | ||
when (cond v) $ do | ||
act v | ||
whileLoopM val cond act | ||
|
||
foldLoopM :: Monad m => a -> m b -> (b -> Bool) -> (a -> b -> m a) -> m a | ||
foldLoopM val sense cond act = r' | ||
where r' = do s <- sense | ||
if cond s | ||
then do | ||
val' <- act val s | ||
foldLoopM val' sense cond act | ||
else return val | ||
where | ||
r' = do s <- sense | ||
if cond s | ||
then do | ||
val' <- act val s | ||
foldLoopM val' sense cond act | ||
else return val |
Oops, something went wrong.