bitbrawl

Main

# Documentation

type DirectedAnimations = Map Direction Animation Source

type Animations = Map String AnimationSet Source

data Direction Source

Constructors

E |
NE |
N |
NW |
W |
SW |
S |
SE |

data Item Source

Constructors

Energy |

Fields

itemAnimation :: (Surface, Animation, Ticks)
energyBonus :: Int
itemShape :: Shape

data Projectile Source

Constructors

Projectile |

Fields

pani :: Maybe (Animation, Ticks, Ticks)
damage :: Int
knockback :: Int
pshape :: Shape
life :: Ticks
pplayer :: Player
deathPos :: Maybe (Vector, Vector)

data AnimationSet Source

Constructors

SimpleAnimation DirectedAnimations |
AbilityAnimation Ability (Map AbilityState DirectedAnimations) |

data AbilityState Source

Constructors

AbilityCharge |
AbilityRelease |

data Ability Source

Constructors

Attack |

Fields

maxDamage :: Int
maxKnockback :: Int
energyCost :: Int
sound :: Maybe String
chargeLen :: Ticks
releaseLen :: Ticks
maxDuration :: Ticks
projectileAnis :: Maybe (DirectedAnimations, Ticks)

Block |

Fields

maxDuration :: Ticks
energyCost :: Int
velocity :: Vector
sound :: Maybe String
chargeLen :: Ticks

data DoingAbility Source

Constructors

DoingAbility |

Fields

abiname :: String
dability :: Ability
started :: Ticks
ended :: Maybe Ticks

data Player Source

Constructors

Player |

Fields

color :: Color
sprites :: Surface
music :: Music
shape :: Shape
control :: Body
controls :: Control
animation :: (Animation, Ticks)
animations :: Animations
ability :: (Maybe DoingAbility, Maybe DoingAbility)
direction :: Direction
speed :: Speed
energy :: Int
damageAmt :: Int
deaths :: Int

data KeyboardAction Source

Constructors

KFace Direction |
KAbility1 |
KAbility2 |
KAbility3 |
KAbility4 |
KStart |
KSelect |

data Action Source

Constructors

Face Direction |
Go Speed |
Ability String |
EndAbility |

data ExistingControl Source

Constructors

IgnoreControl |
AddControl |
STARTControl |

data KeyState Source

Constructors

KeyDown |
KeyUp |

data Control Source

Constructors

KeyboardControl [(SDLKey, KeyboardAction)] |

data Space Source

Constructors

Space Space Ticks Ticks |

class CollisionLayers a where Source

Methods

collisionLayers :: a -> LayersSource

class CollisionType a where Source

Methods

collisionType :: a -> CollisionTypeSource

class Drawable a where Source

Methods

position :: a -> IO (Int, Int)Source

draw :: Surface -> a -> (Int, Int) -> IO ()Source

advance :: a -> Ticks -> aSource

drawByZ :: Surface -> [a] -> IO ()Source

programName :: String Source

frameRate :: Num a => aSource

frameTime :: Num a => aSource

playerSpeed :: Num a => aSource

energyDropTime :: Num a => aSource

timeLimit :: Num a => aSource

windowWidth :: Num a => aSource

windowHeight :: Num a => aSource

getProgramDataDirs :: IO [FilePath]Source

findDataFiles :: (FilePath -> Bool) -> IO [FilePath]Source

switchMusic :: Music -> IO ()Source

splitDirection :: Direction -> [Direction]Source

knockedBack :: Ticks -> Vector -> DoingAbility Source

directionToRadians :: Direction -> AngleSource

getKeyAction :: Control -> SDLKey -> Maybe KeyboardAction Source

doingAbilityState :: DoingAbility -> AbilityState Source

simpleAni :: Map String AnimationSet -> String -> Direction -> Animation Source

selectAnimation :: Player -> Animation Source

updateAnimation :: Ticks -> Player -> Player Source

isEnergy :: Item -> Bool Source

isBlock :: Ability -> Bool Source

randomLocation :: IO VectorSource

deathChance :: Int -> Int -> Int Source

maybeEliminate :: Player -> IO (Bool, Player)Source

winScreen :: Surface -> Map String Font -> [Player] -> IO ()Source

gameLoop :: Surface -> Map String Font -> Map String Chunk -> Surface -> Surface -> Ticks -> [Item] -> Body -> Space -> [Player] -> [Projectile] -> [Item] -> IO ()Source

newPlayer :: Space -> Surface -> Music -> Animations -> Control -> Ticks -> CpFloat -> Group -> IO Player Source

player_parser :: Parser (String, String, Animations)Source

startGame :: Music -> Surface -> Map String Font -> Map String Chunk -> Surface -> Surface -> [((t, Animations, Surface, Music), Control)] -> IO ()Source

playerJoinLoop :: Music -> Surface -> Map String Font -> Map String Chunk -> Surface -> Surface -> [(String, Animations, Surface, Music)] -> IO ()Source

withExternalLibs :: IO a -> IO ()Source

main :: IO ()Source