Skip to content
/ jsrl Public template
forked from slashman/jsrl

JavaScript Roguelike Template - The basics to start building your own

License

Notifications You must be signed in to change notification settings

Earnest-Williams/jsrl

 
 

Repository files navigation

jsrl

JavaScript Roguelike Template - A basic 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 player via web browser or as a native app for Windows, Mac and Linux.

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

What is this good for? the idea is: you take this simple game and start adding and transforming it into what makes your roguelike unique!

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.

Features

  • Player can walk around using keyboard
  • Raycasting Field of View algorithm
  • Player can move between persistent levels
  • Enemies move around chasing the player
  • Player can pick up, drop and use items (including using items on a given direction)
  • Player remember visited maps
  • Infrastructure for Level Generation
  • Line wrap text boxes

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.

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.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-2022 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.

About

JavaScript Roguelike Template - The basics to start building your own

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 95.8%
  • HTML 3.2%
  • CSS 1.0%