Monster

floors

nodes

room

paths

graph

Dungeon

Hello, this an overview of the game https://github.com/oskarrough/slaytheweb

endTurn

MAIN IDEA

Everything revolves around the “game state”. It is a single JavaScript object that describes a state of the game.

To the left you see an example of how you can use actions to play the game.

Let’s play through a couple of turns

applyPower(vulnerable)

Player

GAME STATE

Cards start in the draw pile. Every turn you draw 5 cards from it to your hand. When you play a card, it moves to the discard pile.

When there are no more cards to draw in the draw pile, the discard pile is shuffled into it.

drawPile, hand and discardPile

You can find all actions at https://github.com/oskarrough/slaytheweb/blob/master/public/game/actions.js

To modify the game state, you call different actions. You can see some to the right.

All actions update and return a new game state

The game also has an “action manger queue” that controls the flow of the game

You enqueue and dequeue actions.

OK. That’s the basics of how the game works.

playCard(Bash)

playCard(Strike)

drawCards

drawStarterDeck

createNewGame

removeHealth