Skinney / elm-warrior / Warrior.Map.Progression

In this module you will find functions that define when a map has been won and lost. You can also define your own progression functions if you want to customize the game a bit.


type Progression
    = Advance (List Warrior.Internal.Warrior)
    | GameOver
    | Undecided

There are three ways the course of the game can progress. We can advance certain players to the next map. If there are no maps left, the advanced players are deemed the winners. The game can be lost, also known as game over, or the map can be undecided.


type alias ProgressionFunction =
List Warrior.Internal.Warrior -> Warrior.Map.Map -> Warrior.History.History -> Progression

A function which receives information about the current map played, and decides what the game engine should do next. The function will be called at the end of every turn.

Pre-made progression functions

reachExitPoint : List Warrior.Internal.Warrior -> Warrior.Map.Map -> Warrior.History.History -> Progression

A progression function which advances all players when one has reached an exit point. The game is lost if all players are dead.

lastWarriorStanding : List Warrior.Internal.Warrior -> Warrior.Map.Map -> Warrior.History.History -> Progression

A progression function that ends the game when only one warrior remains. Perfect for deathmatches.

Additional limitations

withRoundLimit : Basics.Int -> ProgressionFunction -> ProgressionFunction

Takes in a progression function and ends the game if the original progression function is undecided, and a certain number of rounds has passed.