Skip to content

πŸ§‘β€πŸ’» Turn-based RPG written in TypeScript along with Ink and React

Notifications You must be signed in to change notification settings

HiImFelipe/Node-RPG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

69 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NodeRPG

image

Role-Playing Game inside the terminal with Ink and React!

Navigation

What?? React on the Terminal?

It is definitely not even close to a simple game-engine with pre-built functionalities, but React brings a lot of power to the table when it comes to dynamically rendering objects and dealing with events without the need to go for event-driven back-end designs.

It comes with a lot of downsides though:

  • You don't have all the flex properties;
  • You can't add styling to all components;
  • Ink still has not that many libraries available to make your life easier (It was made to create interactive CLIs more easily, they are not very complex);
  • If you don't name your components yourself in a separate file, it becomes really unreadable really fast;
  • ...

TL;DR: React is not the right tool for the job, but this is a challenge. I don't recommend trying this out, but coding like this is fun.

Structure

  • Every "map" in your conventional RPG game is considered a Scene;
  • Each Scene is rendered dynamically by a SceneLoader component;
  • Every Scene has Events, and each one of them is rendered dynamically aswell;

This happens so we can easily travel between them without the need to go for a step-by-step approach and make things more independent.

Running in your machine

Requirements

  • NodeJS
  • TypeScript
  • Yarn*

Everything can be done with NPM, but you better change the package.json scripts to match NPM instead of Yarn

Commands

To install the dependencies, run:

yarn

Once everything is installed and an auto-generated node_modules pop's up, run the following:

yarn start

About

πŸ§‘β€πŸ’» Turn-based RPG written in TypeScript along with Ink and React

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published