Code Monkey home page Code Monkey logo

jafnatta's Introduction

Jafnatta

An engine for a deckbuilding game.

Developing

You'll need Node v12 or newer, and npm, which comes bundled with Node. Install the dependencies with npm install, then npm start will run the compiler & testing interface, and watch for changes to the code.

Architecture

Jafnatta is written in Typescript, and uses Redux and Redux Thunks. Most of the game logic is implemented either as middleware (which can dispatch actions and control the incoming action), or as thunks (which can also dispactch actions, can be waited for by other actions, but can't control the dispatch of the current action), with a handful of reducers (which can only alter the state).

The core engine is separate to any user interface. There's an interactive command line interface in test.ts that demonstrates how an interface communicates with the game engine:

  • The engine exposes state that should be displayed to the player
  • It will dispatch actions such as ask-for-card and ask-for-supply-card that should prompt the player to choose a card from the appropriate location
  • The interface can do this however it likes, but must dispatch a choose-card or choose-supply-card action with the selected card.

In the future there'll be a split between a core engine and a player engine, to hide sensitive information like deck order and opponent cards.

Still to implement

  • Multiple players
  • Game end conditions
  • Information hiding

What's up with the name

"Jafnátta" means "equal in every direction" in Icelandic.

Licence

Parity Public Licence, 7.0.0

Castle icon created by Alice Noir on Noun Project

jafnatta's People

Contributors

amyworrall avatar apaleslimghost avatar

Watchers

 avatar  avatar  avatar

Forkers

amyworrall

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.