Safe HaskellNone

Types

Synopsis

Documentation

data Key #

Type to represent different keys on the keyboard

Constructors

Key Key 

Instances

Eq Key # 

Methods

(==) :: Key -> Key -> Bool

(/=) :: Key -> Key -> Bool

data Point #

Type to represent a point in two dimensions, where each constructor specifies what the point is for

Constructors

Position Float Float 
Velocity Float Float 
Acceleration Float Float 

Instances

Eq Point # 

Methods

(==) :: Point -> Point -> Bool

(/=) :: Point -> Point -> Bool

Show Point # 

Methods

showsPrec :: Int -> Point -> ShowS

show :: Point -> String

showList :: [Point] -> ShowS

data Turret #

Type for representing the properties of the turrret of a tank

Constructors

Turret 

Fields

  • angle :: Float

    The angle of the turret with respect to the tank

  • power :: Float

    The power chosen by the user for launching

Instances

Show Turret # 

Methods

showsPrec :: Int -> Turret -> ShowS

show :: Turret -> String

showList :: [Turret] -> ShowS

data Direction #

Type to specify the direction, left or right. Used by weapons and tanks

Constructors

FacingLeft 
FacingRight 

data TankState #

Type to represent the state variables of a tank

Constructors

TankState 

Fields

Instances

Show TankState # 

Methods

showsPrec :: Int -> TankState -> ShowS

show :: TankState -> String

showList :: [TankState] -> ShowS

data Tank #

Type to represent a tank in the game

Constructors

Tank 

Fields

  • tankState :: TankState

    The state of the tank

  • score :: Float

    The score of the player using the tank, i.e., the health of the tank

  • color :: Color4 Float

    The colour of the tank, which depends on the player and score

  • currentWeapon :: Int

    The weapon being currently used

  • weaponCount :: [Integer]

    The number of weapons of the current type available

Instances

Show Tank # 

Methods

showsPrec :: Int -> Tank -> ShowS

show :: Tank -> String

showList :: [Tank] -> ShowS

data Tile #

Type to represent a tile in the tile map of the game

Constructors

Tile 

Fields

  • tilePosition :: Point

    The position of the bottom left corner of the tile on the screen

  • isObstacle :: Bool

    Whether the position of the tile is an obstacle or not

Instances

Show Tile # 

Methods

showsPrec :: Int -> Tile -> ShowS

show :: Tile -> String

showList :: [Tile] -> ShowS

data GameState #

Type to represent the state of the game

Constructors

GameState 

Fields

Instances

Show GameState # 

Methods

showsPrec :: Int -> GameState -> ShowS

show :: GameState -> String

showList :: [GameState] -> ShowS

data Weapon #

Type to represent the weapons in the game

Constructors

GenericWeapon 

Fields

Instances

Show Weapon # 

Methods

showsPrec :: Int -> Weapon -> ShowS

show :: Weapon -> String

showList :: [Weapon] -> ShowS

data WeaponGraphics #

Type to represent the graphics properties of a weapon

Constructors

WeaponGraphics 

Fields

Instances

Show WeaponGraphics # 

Methods

showsPrec :: Int -> WeaponGraphics -> ShowS

show :: WeaponGraphics -> String

showList :: [WeaponGraphics] -> ShowS

tileMatrixRowSize :: Int #

Number of rows in the tile matrix

tileMatrixColumnSize :: Int #

Number of columns in the tile matrix

widthOfTile :: Float #

Width of a tile in the tile matrix

heightOfTile :: Float #

Height of a tile in the tile matrix

widthOfTank :: Integer #

Width of the tank in terms of the number of tiles

heightOfTank :: Integer #

Height of the tank in terms of the number of tiles

powerIncrement :: Float #

The amount by which the power changes per key press

angleIncrement :: Float #

The amount by which the angle, in radians, changes per key press

isIndexInRange :: [a] -> Int -> Bool #

Function to check if the current index is in the range of the tile map or not