Giter VIP home page Giter VIP logo

achiever's Introduction

Achiever

An Achievement Platform. Achiever provides a library upon which you could build a game or any other product that wants to allow its users to unlock achievements.

On the whole, Achiever is designed to help build a batch-processing based model for calculating what achievements a given user has unlocked.

At the highest level, the integration story for Achiever is:

  1. Write sub-classes of Achiever::Achievement or Achiever::ParameterizedAchievement in your application, defining #unlocks_for_user.

  2. Write a "runner" method that builds an AchieverContext 2a. For any parametized achievements, add the appropriate static DefinitionDatum objects to a DefinitionDatum provider 2b. Register your Achievement classes on an AchievementProdiver object 2c. Generate and then fill our a metadata yml file, provide its path to an AchievementMetaDataProvider object

  3. Define an object that you will use as User Data. An instance of this object should contain all of the necessary information to determine whether an achievement is unlocked for a player.

As you can see, Achiever itself doesn't do a whole bunch of work for you. But in that same regard, Achiever tries not to restrict what you can do with the system. By taking a batch-oriented approach by defaut, we should be able to build a more iterative system if needed on top of the batching.

Parameterized Achievements

Say for example, your game has 20 different monsters, and you want to provide an achievement for killing 100, 1000, 5000, and 10000 of each type of monster. That's a lot of repetition. By using Parameterized Achievements and Definition Data, Achiever will expand the template out into all the possible combinations. It forms a cartesian product of the provided definition objects (grouped by class)

Defines

you can define a Define (heh) by including it as a module:

class Monster
  include Achiever::Define

  attribute :name, String

  def id
    self.name.to_url
  end
end

You can then register instances of this object on a Define Provider for later expansion.

Installation

Add this line to your application's Gemfile:

gem 'achiever'

And then execute:

$ bundle

Or install it yourself as:

$ gem install achiever

Usage

TODO: Write usage instructions here

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

achiever's People

Contributors

nullstyle avatar

Watchers

 avatar

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.