• Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated 8 months ago

Reviews

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

Repository Details

JavaScript/TypeScript Roguelike Template - The basics to start building your own

jsrl

JavaScript Roguelike Template - A basic TypeScript roguelike you can build upon to create your own

PIXI graphics display UnicodeTiles character display

What is this?

JSRL is a bare-bones roguelike featuring both tiles and character-based displays. It can be played via a web browser or as a native app for Windows, Mac, and Linux.

Check out the online demo at: https://slashie.net/jsrl

You can use this simple skeleton game as a starting point for your full-fledged roguelike, by building on top of it and taking advantage of its features:

  • Walk around using the keyboard
  • Raycasting Field of View algorithm
  • Movement between persistent levels
  • Enemies moving around chasing the player
  • An action system including actions to pick up, drop, and use items
  • Memory of visited areas.
  • Infrastructure for Level Generation
  • Line wrap text boxes

Development philosophy

The unique goal of JSRL is to provide an advanced "starting point" for your project and then NOT get in your way. That is why it isn't structured as an engine whose abstractions you have to learn in order to build upon it, but rather as a small set of classes and objects that you will very likely progressively replace with your own.

JSRL-based projects are completely detached from the JSRL template; once you start developing your project you are on your own. In other words, the main thing you have to understand is that JSRL is just a sample roguelike.

The development of JSRL is driven by developers optionally back-porting the improvements made while developing their own games into it; contributions are cherry-picked for JSRL to remain as simple as possible while providing future developers with added utilities for their games. (An example is the addition of automatic viewport scaling).

As you can see in the JSRL demo, you will get quite a boost with tile-based display, keyboard-based movement, level handling, a turns system controlling the sequence of the actions of simulated world populators, and a simple inventory.

Along with that you also get all the tooling to develop the game and deploy it for web or PC via electron.

How to use

JSRL is designed for you to take a snapshot of the repository, and then part ways with it to create your game.

Tutorials on how to create your game around the basic codebase will come soon.

TypeScript

JSRL uses typescript and includes the tools to compile it so it can be used in any browser.

In case you want to remove TypeScript support and dependencies, you can use the js branch. However, note that you can develop in vanilla JS if you wanted, even with typescript active.

Local Development Server

Local development can occur in two flavours: web, or electron. In both environments, changes to your source are hot-reloaded.

Web

  • npm install
  • npm run web OR npm run web:pixi
  • Open your browser to http://localhost:8080

Electron

  • npm install
  • npm run electron OR npm run electron:pixi

Building and Distribution

Distribution files are also seperated by either web or electron targets.

Web

  • npm run build:web OR npm run build:web:pixi
  • Directory dist/web will contain the web directory contents you can serve or FTP

Electron

  • npm run package:<one of *win32*, *mac* or *linux*> OR npm run package:<one of *win32*, *mac* or *linux*>:pixi
  • Directory dist will contain the distribution folders for the given platform

Version History

  • 0.0.5 - February 23, 2023 - Migration to TypeScript
  • 0.0.4 - November 26, 2022 - PIXI graphical version
  • 0.0.3 - November 19, 2022 - Electron packaging, viewport scaling
  • 0.0.2 - March 2021 - Added support for static maps loading
  • 0.0.1 - November 2017 - Initial version based on PokemonRL codebase

Credits

LICENSE

MIT License

Copyright (c) 2017-2023 Santiago Zapata

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

OpenArthurianX6

An engine to create RPGs similar to Ultima 6
JavaScript
20
star
2

libjcsi

Automatically exported from code.google.com/p/libjcsi
Java
17
star
3

ultimaCastleGen

Generator for castle maps inspired by Ultima V
JavaScript
16
star
4

roguenet

A social space inspired by traditional character display roguelikes
JavaScript
15
star
5

monster-trainer-rl

An open source monster training roguelike game
JavaScript
10
star
6

circular

A JS lib to serialize objects with circular references
JavaScript
7
star
7

programmers-seal-of-approval

Add the programmers' seal of approval to your software
HTML
6
star
8

castlevaniarl

A traditional roguelike inspired by the Castlevania game series
Java
6
star
9

elite-international-detective

A detective traditional roguelike game.
Java
4
star
10

zeldarl

A fan-made traditional roguelike inspired by Zelda
Java
4
star
11

slashbot

A fun IRC bot for role playing and stuff, powered by node-irc
JavaScript
4
star
12

buw-design

Britannian Underworld Design
4
star
13

stygiangen

Level Generator for the Stygian Abyss project
JavaScript
3
star
14

rodney

Automatically exported from code.google.com/p/rodney
JavaScript
3
star
15

rogueprogram

โ€‹The ROGUE program has activated and is corrupting the characters on the AVRS system.
JavaScript
3
star
16

koe

Kingdom of Elias - A light online strategy game
JavaScript
2
star
17

lostjs13k

Lost in Astarion, my entry for js13k 2017
JavaScript
2
star
18

queenOfWesteros

Queen of Westeros
JavaScript
2
star
19

metroidrl

Automatically exported from code.google.com/p/metroidrl
Java
2
star
20

js13k2020

JavaScript
1
star
21

lorenzo

A game about a bull trying to save his family from being murdered after killing a bullfighter
JavaScript
1
star
22

savageEmpireSnesTranslation

A set of tools to aid in the translation to English of the Savage Empire Super Famicom ROM
Java
1
star
23

ruler-rl

Automatically exported from code.google.com/p/ruler-rl
Java
1
star
24

megamanrl

Automatically exported from code.google.com/p/megamanrl
Java
1
star
25

mtdrashroguelike

Automatically exported from code.google.com/p/mtdrashroguelike
Java
1
star
26

js13k2023

The First Horde - An entry for js13kgames 2023
JavaScript
1
star
27

roguelike-in-a-tweet

Efforts to create roguelike games with extreme code size constraints
HTML
1
star
28

fsv

Farewell San Vicente - GGJ 2023 Entry
ShaderLab
1
star
29

exult-tbc

Adding Turn Based Combat to Exult Ultima 7 Engine
C++
1
star
30

backpackMonsters

JavaScript
1
star
31

phaserTextField

A textfield component to be used in phaser games
JavaScript
1
star
32

catcafe

A game where you are the waitress on a Cat Cafe and have to deliver desserts to impatient cats.
JavaScript
1
star
33

timezonrr

A simple utility to generate multi-timezone schedules
HTML
1
star
34

expedition

Automatically exported from code.google.com/p/expedition
Java
1
star