LambdaHack-0.2.10: A roguelike game engine in early and active development

Safe HaskellNone

Game.LambdaHack.Common.Animation

Description

Screen frames and animations.

Synopsis

Documentation

data Attr

Text attributes: foreground and backgroud colors.

Constructors

Attr 

Fields

fg :: !Color

foreground colour

bg :: !Color

backgroud color

Instances

Eq Attr 
Ord Attr 
Show Attr 
Binary Attr 

defAttr :: Attr

The default attribute, to optimize attribute setting.

data AttrChar

Constructors

AttrChar 

Fields

acAttr :: !Attr
 
acChar :: !Char
 

Instances

data SingleFrame

The data sufficent to draw a single game screen frame.

The fields are not strict, because sometimes frames are not used, e.g., when a keypress discards all frames not yet drawn and displayed.

Constructors

SingleFrame 

Fields

sfLevel :: [[AttrChar]]

content of the screen, line by line

sfTop :: Text

an extra line to show at the top

sfBottom :: Text

an extra line to show at the bottom

data Animation

Animation is a list of frame modifications to play one by one, where each modification if a map from positions to level map symbols.

type Frames = [Maybe SingleFrame]

Sequences of screen frames, including delays.

renderAnim :: X -> Y -> SingleFrame -> Animation -> Frames

Render animations on top of a screen frame.

twirlSplash :: (Point, Point) -> Color -> Color -> Animation

Attack animation. A part of it also reused for self-damage and healing.

blockHit :: (Point, Point) -> Color -> Color -> Animation

Attack that hits through a block.

blockMiss :: (Point, Point) -> Animation

Attack that is blocked.

deathBody :: Point -> Animation

Death animation for an organic body.

swapPlaces :: (Point, Point) -> Animation

Swap-places animation, both hostile and friendly.

fadeout :: Bool -> Bool -> X -> Y -> Rnd Animation

data DebugModeCli

Constructors

DebugModeCli 

Fields

sfont :: !(Maybe String)

Font to use for the main game window.

smaxFps :: !(Maybe Int)

Maximal frames per second. This is better low and fixed, to avoid jerkiness and delays that tell the player there are many intelligent enemies on the level. That's better than scaling AI sofistication down based on the FPS setting and machine speed.

snoDelay :: !Bool

Don't maintain any requested delays between frames, e.g., for screensaver.

snoMore :: !Bool

Auto-answer all prompts, e.g., for screensaver.

snoAnim :: !(Maybe Bool)

Don't show any animations.

snewGameCli :: !Bool

Start a new game, overwriting the save file.

ssavePrefixCli :: !(Maybe String)

Prefix of the save game file.

sfrontendStd :: !Bool

Whether to use the stdout/stdin frontend.

sdbgMsgCli :: !Bool

Show clients' internal debug messages.