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

Safe HaskellSafe-Infered

Game.LambdaHack.VectorXY

Description

Basic cartesian geometry operations on 2D vectors.

Synopsis

Documentation

newtype VectorXY Source

2D vectors in cartesian representation.

Constructors

VectorXY (X, Y) 

Instances

shiftXY :: PointXY -> VectorXY -> PointXYSource

Shift a point by a vector.

movesXY :: [VectorXY]Source

Vectors of all unit moves in the chessboard metric, clockwise, starting north-west.

movesCardinalXY :: [VectorXY]Source

Vectors of all cardinal direction unit moves, clockwise, starting north.

chessDistXY :: VectorXY -> IntSource

The lenght of a vector in the chessboard metric, where diagonal moves cost 1.

euclidDistSqXY :: VectorXY -> IntSource

Squared euclidean length of a vector.

negXY :: VectorXY -> VectorXYSource

Reverse an arbirary vector.