npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cartesi/creepts-mappack

v0.4.0

Published

Creepts Game Map Pack

Downloads

9

Readme

Creepts Map Pack

Creepts is a decentralized tower defense game that showcases Cartesi.

This repo hosts the maps and game configuration files that powers the Creepts Game Engine, which is designed to be exensible and not depend on the map or some game rules, like the player initial credits or number of lives.

Usage

There are two main concepts: Maps and Levels:

Maps

A Map is a definition of a grid with possible locations for turrets and a linear path for the enemies. If the map does not define the positions of turrets that means all locations (other than the path) are available.

All maps are stored as json files at src/maps in a structure that complies with the Creepts Engine MapObject. A function is provided to load a map based on its name, which translates to the name of the json file:

import { loadMap } from "@cartesi/creepts-mappack";

// load the map named original
const map: MapObject = loadMap("original");

For a complete list of available maps check the directory src/maps. There is also a function which returns an array of the names of all available maps.

import { maps } from "@cartesi/creepts-mappack";

// get the list of map names
const maps: string[] = maps();

Levels

A Level is consisted of a Map, a game configuration (like initial credits and lives), and a definition of the enemy waves. Levels are not stored as json files is this repo. They are built based on a MapObject and a static set of configuration. This configuration is stored as json files at src/resources, and that includes:

  • enemies.json: attributes of every enemy type, like its life and speed
  • turrets.json: basic attributes of every turret, like its price
  • waves.json: an array that defines the waves of enemies

A function is provided to create a LevelObject from a MapObject:

import { loadLevel } from "@cartesi/creepts-mappack";

// create a LevelObject from a MapObject
const level: LevelObject = loadLevel(map);

Build

To get a list of all the available npm targets run:

% npm run info

Contributing

Thank you for your interest in Cartesi! Head over to our Contributing Guidelines for instructions on how to sign our Contributors Agreement and get started with Cartesi!

Please note we have a Code of Conduct, please follow it in all your interactions with the project.

License

This repository and all contributions are licensed under APACHE 2.0. Please review our LICENSE file.

Acknowledgments

  • Original work