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

Safe HaskellNone

Game.LambdaHack.Common.VectorXY

Description

Basic cartesian geometry operations on 2D vectors.

Synopsis

Documentation

newtype VectorXY

2D vectors in cartesian representation.

Constructors

VectorXY (X, Y) 

shiftXY :: PointXY -> VectorXY -> PointXY

Shift a point by a vector.

movesXY :: [VectorXY]

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

movesCardinalXY :: [VectorXY]

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

chessDistXY :: VectorXY -> Int

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

euclidDistSqXY :: VectorXY -> Int

Squared euclidean length of a vector.

negXY :: VectorXY -> VectorXY

Reverse an arbirary vector.