@rbxts/ejt
v2.0.5
Published
A library for interacting with difficulties in the EToH Joke Towers wiki.
Readme
EToH Joke Towers
An API for managing and interacting with the EToH Joke Towers Difficulty Chart. This package provides a structured way to define, organize, and retrieve difficulty levels, complete with metadata such as names, images, colors, and ratings.
Installation
Install the package via npm:
npm install @rbxts/ejtUsage
Importing the Library
import Difficulty from "@rbxts/ejt";Accessing Predefined Difficulties
You can access predefined difficulties directly as static properties of the Difficulty class:
const firstDifficulty = Difficulty.TheFirstDifficulty;
console.log(firstDifficulty.name); // "The First Difficulty"
console.log(firstDifficulty.layoutRating); // -10000010Retrieving Difficulties by ID
Use the get method to retrieve a difficulty by its unique ID:
const difficulty = Difficulty.get("TheLowerGap");
if (difficulty) {
console.log(difficulty.name); // "The Lower Gap"
}Creating Custom Difficulties
You can create custom difficulties by chaining the provided methods:
const customDifficulty = new Difficulty()
.setName("Custom Difficulty")
.setImage(1234567890)
.setColor(Color3.fromRGB(255, 0, 0))
.setRating(42)
.setClass(1);
const id = "CustomDifficulty";
Difficulty.set(id, customDifficulty);Development
Prerequisites
- Node.js
- npm
- Roblox TypeScript (roblox-ts)
Setup
- Clone the repository:
git clone https://github.com/evilbocchi/ejt.git
cd ejt- Install dependencies
npm install- Build the project:
npm run buildContributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push the branch.
- Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
