0.3.2 • Published 1 year ago

libclicker v0.3.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Libclicker

JS library for clicker games

This javascript library helps to build clicker/idle/incremental games providing a set of building pieces usually found on these kind of games. If you dont know the genre and want to try one, please visit this complete list To support all the math and balance decisions in your development this article is pretty useful

Install

CDN

Link directly to Masonry files on unpkg.

<script src="https://unpkg.com/libclicker/dist/libclicker.js"></script>
<!-- or -->
<script src="https://unpkg.com/libclicker/dist/libclicker.min.js"></script>

Initialize

Usage

let world = new World();
world.update(1.0 / 60.0);

// Creates a new currency called "Gold"
let gold = new Currency.Builder(world)
    .name("Gold")
    .build();

let goldMine = new Creator.Builder(world)
    .generate(gold)   // Generate gold
    .baseAmount(10)   // Defaults to 10 gold per tick
    .multiplier(1.15) // Increase amount by 15 % per level
    .price(100)       // Price of level 1 gold mine
    .priceMultiplier(1.25) // Increase price by 25 % per level
    .build();

// Advance the world by 30 seconds to make the automator work
world.update(30.0);

Roadmap

  • Documentation X
  • Example Game []
  • BigInt support []

Credits

A javascript port based on the good libclicker2 by @manabreak