Nibbling Perfect Macaroni
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

This package has been deprecated

Author message:

This is an old project...

properjs-gamequest

0.2.0 • Public • Published

GameQuest

Keep a log of a games quests and their statuses.

Installation

npm install properjs-gamequest --save-dev

Usage

GameQuest will utilize localStorage. So, quest state is persisted and it will try to load from storage on initialization.

var GameQuest = require( "properjs-gamequest" );
var gameQuest = new GameQuest();
 
// Add a new quest
if ( !gameQuest.isQuestComplete( "my-quest" ) ) {
    // You now have an un-fulfilled quest in the log
    gameQuest.addQuest( "my-quest" );
}
 
// Fulfill a quest
if ( /* some player action */ ) {
    gameQuest.completeQuest( "my-quest" );
}
 
// Also
gameQuest.getQuest( id );
gameQuest.removeQuest( id );
gameQuest.getQuest( id );
 
// See all
gameQuest.getQuests();
 
// Save to localStorage manually
// GameQuest automatically does this for you though
gameQuest.setQuests();

install

npm i properjs-gamequest

Downloadsweekly downloads

0

version

0.2.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar