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

    properjs-gamequestpublic

    This package has been deprecated

    Author message:

    This is an old project...

    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

    5

    version

    0.2.0

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar