• Stars
    star
    2,258
  • Rank 19,521 (Top 0.4 %)
  • Language
    JavaScript
  • License
    BSD 3-Clause "New...
  • Created almost 12 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!

rot.js

ROguelike Toolkit in JavaScript. For more info, see https://ondras.github.io/rot.js.

Library

There are multiple ways of including rot.js in your project.

Downloading

You can get rot.js using either of these methods:

Usage

Rot.js is written in TypeScript, but its code is available in multiple formats. You can pick the one that best suits your development needs.

  1. The lib/ directory contains the code in ES2015 modules. These can be used in modern browsers directly, without any transpilation/bundling step. An example shows how to do that.

  2. For practical reasons, individual modules should be bundled to make your application more compact. You are free to use any bundler that understands ES2015 modules. If you want to support older browsers, you should also transpile your code -- there is an example using babel and rollup that shows how to do that. This is the recommended way of using rot.js.

  3. If you do not fancy modern modules and/or transpilation, you can grab a pre-built bundle and include it in your page using traditional <script> tag. This bundle puts rot.js into a global ROT namespace and uses ES5 (supported even by older browsers). See an example of this approach.

  4. Finally, the pre-built budle also comes with a minified version that works the same, but its size has been reduced. The usage is the same as in the previous example.

Node.js

Most parts of rot.js are usable from within node.js (server-side JavaScript). The Display class needs to use the "term" layout backend:

let display = new ROT.Display({width:40, height:9, layout:"term"});
display.draw(5,  4, "@");
display.draw(15, 4, "%", "#0f0");          // foreground color
display.draw(25, 4, "#", "#f00", "#009");  // and background color

Usage

The pre-bundled rot.js package can be loaded as a CommonJS module. There is an example that shows basic usage.

Contributing

ROguelike Toolkit is largely considered "feature-complete", but bugfixes, documentation, and some new features are welcomed. Development should happen in the /src folder, and then the build process creates the /lib, /dist, and /doc folders before serving the project.

Visual layout of the build process

The command to rebuild everything:

npm install
make all

Misc

RogueBasin page (with links to some rot.js-based games): http://roguebasin.com/index.php/Rot.js

More Repositories

1

my-mind

Online Mindmapping Software
TypeScript
3,175
star
2

wwwsqldesigner

WWW SQL Designer, your online SQL diagramming tool
JavaScript
2,781
star
3

primitive.js

JS port of primitive.lol
JavaScript
762
star
4

sleeping-beauty

Sleeping Beauty: a game created for the 7-day Roguelike 2014 challenge. Coffeebreak length.
JavaScript
135
star
5

trw

The Royal Wedding – coffebreak roguelike with story, lighting, zombies and (sometimes) lutefisk!
JavaScript
126
star
6

cyp

Control Your Player: a Web-based MPD client
JavaScript
92
star
7

rri

TypeScript port of a board game by Horrible Games
TypeScript
85
star
8

fireworks-webgl

WebGL + Web Audio API = Sound-driven fireworks!
JavaScript
59
star
9

jsslides

Where semantic HTML meets interactive slide deck
JavaScript
45
star
10

browsershot

Utility library for programmatic screenshots via getDisplayMedia
JavaScript
44
star
11

oscope

Configurable JavaScript oscilloscope
JavaScript
42
star
12

goldfish

Goldfish: a game created for the 7-day Roguelike 2017 challenge. Playable, winnable, losable. Features colorful and aesthetic maps, aquatic fauna and fishermen!
JavaScript
29
star
13

rollup-plugin-graph

Generates module dependencies graph, using the DOT language.
JavaScript
28
star
14

TeaJS

Your daily cup of server-side Javascript.
C++
26
star
15

rubik

CSS Rubik's Cube
JavaScript
24
star
16

cfo

A two-pane file manager
JavaScript
23
star
17

drago

Dr. Drago's Madcap Chase: HTML5 remake of an old game by Blue Byte Software. Fully playable with cool graphics, animations, sounds and music!
JavaScript
20
star
18

promise

Tiny browser-based Promises/A+ implementation
JavaScript
19
star
19

javascript

JavaScript
16
star
20

cafe-havoc

Café Havoc: a game created for the 7-day Roguelike 2016 challenge
JavaScript
16
star
21

iv

Simple image viewer for nw.js and Electron
JavaScript
14
star
22

fastiles

Ultra-fast bitmap font renderer
TypeScript
13
star
23

conception

The Conception: a game created for the 7-day Roguelike 2013 challenge. Contains hexagons. And chlamydia. And much more.
JavaScript
13
star
24

photo

Web Workers used to process photos
JavaScript
13
star
25

little-planet

<little-planet> Custom Element: interactive panorama viewer
JavaScript
13
star
26

mp

Hybrid music player
JavaScript
12
star
27

dobble

Dobble / Spot it! with Emoji
JavaScript
10
star
28

gps-exif

Visualizing GPS EXIF data on a map
JavaScript
10
star
29

elm-slides

Slide deck system written in Elm
JavaScript
10
star
30

js-like

js-like, the JavaScript Roguelike. Heavily inspired by ADOM.
JavaScript
9
star
31

just-spaceships

Multiplayer 2d space dogfighting game
JavaScript
8
star
32

smon

simple service monitoring
JavaScript
8
star
33

pasy.js

Simulating particle systems with WebGL
JavaScript
8
star
34

dragons

Here be dragons! Curved dragons in particular. At least several generations of then.
JavaScript
7
star
35

instant-button

<instant-button> web component
HTML
7
star
36

oz.js

Tiny but smart JS assistance for advanced coders
JavaScript
6
star
37

ws2mpd

Tiny WebSocket <-> MPD bridge
JavaScript
6
star
38

es6-boilerplate

ES6+/TS boilerplate
Makefile
6
star
39

experimental-roguelike

Exploring innovative and aesthetical aspects of an ASCII game
JavaScript
6
star
40

railrl

Small testbed game: hexes, trains, procedurally generated terrain.
JavaScript
6
star
41

need-based-ai

A sample need-based AI implementation
6
star
42

html5-animation-framework

Google Code mirror
JavaScript
4
star
43

ie8eventtarget

EventTarget polyfill for IE8
JavaScript
4
star
44

turbo-visionary

Turbo Visionary: bringing back the 90s IDE styling
CSS
4
star
45

rnotify

Forwarding remote notifications to a local machine
Python
4
star
46

fractal

Mozilla DevDerby Demo
JavaScript
4
star
47

roguezombies

Rogue Zombies: a roguelike game. Warning: they will get you.
JavaScript
4
star
48

draw

Drawing in multiplayer (server needed)
JavaScript
4
star
49

wardens-duty

Warden's Duty: a game created for the 7-day Roguelike 2015 challenge. Lacks the traditional roguelike map and features over-sized ascii glyphs. You cannot really win this game, but you can try to get deeper than others.
JavaScript
4
star
50

arduino

Experimental sketches
C++
3
star
51

hash

Mozilla DevDerby Demo
JavaScript
3
star
52

firecommander

Two-pane file manager
JavaScript
3
star
53

rustymind

impl Mastermind for Rust {}
Rust
3
star
54

maslo

Scalable Markdown-based HTML slide deck
CSS
3
star
55

coral

Canvas & Web Workers Demo
JavaScript
3
star
56

rogue-sea

Rogue Sea: a game created for the 7-day Roguelike 2021 challenge. Features ships, cannonballs, bitmap tiles, spatial audio and a nontrivial amount of piratey talk.
JavaScript
3
star
57

perfect-maze

Produces a perfect maze and finds the path between two corners. In perfect maze, every two cells are connected with exactly one path.
JavaScript
3
star
58

pure-css-slides

A non-JavaScript experiment: fully featured presentation system, using only HTML + CSS
CSS
3
star
59

7drl-2019

The Curse of the General Sibling Combinator: a game created for the 7-day Roguelike 2019 challenge. Implemented only in CSS. Coffeebreak length.
PHP
3
star
60

blockout

CSS Blockout implemented using CSS 3D transforms. Submitted as a demo to Mozilla Dev Derby.
JavaScript
3
star
61

screenplay.css

A screenplay stylesheet
CSS
3
star
62

piano-chords

Realtime chord detector
JavaScript
2
star
63

atoms

Traditional "atoms" game, well-known from Windows 3.1. Up to four players; local play with bots, multiplayer using Firebase.
JavaScript
2
star
64

tiled-engine

Experimental tile-based engine with multi-tile entities
JavaScript
2
star
65

cf-speech

CloudFlare Speech app
HTML
2
star
66

ahk

Collection of AutoHotkey scripts that I use.
AutoHotkey
2
star
67

sudoku

Sudoku solver
JavaScript
2
star
68

ardulike

A roguelike for arduino.
C++
2
star
69

ogar

Ondras's Genetic Algorithm Runner
TypeScript
2
star
70

dw

Experimenting with custom implementation of document.write
JavaScript
2
star
71

chords

Generating and rendering chord diagrams
JavaScript
2
star
72

emojimage

Create SVG images/favicons from emoji
TypeScript
2
star
73

fixmetodo

<fix-me> and <to-do> web components
JavaScript
2
star
74

hex-maps

Creates SVG maps for the "Expres" game (also known as Dampfross, Railway Rivals)
JavaScript
2
star
75

3

Shadow cube (particularly known from GEB) generator
JavaScript
2
star
76

codeface-roguelike

Display monospace fonts from the "codeface" project in a roguelike-compatible fashion
JavaScript
2
star
77

polar-image

Rect-to-polar image converter
HTML
2
star
78

cookie-roller

Image → STL → Roller → Cookies
JavaScript
2
star
79

qr

Generate QR code based on the Referer header
TypeScript
1
star
80

ws2irc

WebSocket <-> IRC bridge
JavaScript
1
star
81

oz.php

PHP library for easier MVC workflow, based on XSLT.
PHP
1
star
82

kb

A personal knowledge base
1
star
83

syntax

RE-based syntax highlighter, implemented in Javascript.
JavaScript
1
star
84

harmoniums

A semi-interactive homage to Kurt Vonnegut
JavaScript
1
star
85

backup

Wasabi+Duplicity
Shell
1
star
86

ex-ample

<ex-ample> Web Component for interactive HTML/JS examples
JavaScript
1
star
87

elm-irc

Elm IRC client library
HTML
1
star
88

gc

Mobile geocaching client
JavaScript
1
star
89

teajs-tools

Google Code mirror
Shell
1
star
90

nemu

NEtworked MUltiplayer WIP
JavaScript
1
star
91

zombie

A minimalistic Jasmine test driver
JavaScript
1
star
92

a-g-e

Adventure Game Engine, suitable for playing interactive gamebooks
JavaScript
1
star
93

space-filling-curves

Recursive implementation of Peano/Hilbert curves, using canvas transformations
HTML
1
star
94

wsl

WSL2 utilities
Shell
1
star
95

email-hash

E-mail canvas hash: visualizing e-mail addresses using various algorithms
JavaScript
1
star
96

custom-range

A stylable replacement for <input type=range>
JavaScript
1
star
97

worms

Worm simulation using HTML <canvas>
JavaScript
1
star
98

wild-west

Browser-based arena for simple but interesting fights of JavaScript AIs, based on a child's play
JavaScript
1
star
99

fireworks

JavaScript fireworks using elementary mechanics, <canvas> and <audio> tags
JavaScript
1
star