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

Safe HaskellNone



Running and disturbance.



run :: (Vector, Int) -> ActionFrame ()Source

Start running in the given direction and with the given number of tiles already traversed (usually 0). The first turn of running succeeds much more often than subsequent turns, because most of the disturbances are ignored, since the player is aware of them and still explicitly requests a run.

continueRun :: (Vector, Int) -> Action ()Source

This function implements the actual logic of running. It checks if we have to stop running because something interesting cropped up, it ajusts the direction given by the vector if we reached a corridor's corner (we never change direction except in corridors) and it increments the counter of traversed tiles.