Skip to content

redis-developer/cache-quest

Repository files navigation

Information

Play the game at: redis.io/cache-quest

This is the source code for Cache Quest, a browser rpg/rougelite game powered by Redis and built using KAPLAY.js.

Placeholder character sprites

This game uses Tiny Swords characters created by Pixel Frog. Characters sprites that can be downloaded free of charge are kept intact with permission of the artist. Character sprites that cannot be redistributed are replaced with whitespace placeholder art.

How to run this project

There are two ways to run this project once you've cloned the repo. You can run this project locally using Docker which pulls the latest alpine image of Redis. Alternatively, you can run this using Node with Redis Cloud.

Option 1: Run using Docker

1. Copy and rename the .env.docker.example file

cp .env.docker.example .env.docker

2. Verify the .env.docker file:

Your .env.docker should use the appropriate docker internal URLs.

REDIS_URL="redis://redis:6379"

Your .env should use localhost for the REDIS_URL

REDIS_URL="redis://localhost:6379"
REDIS_SESSION_PREFIX = "sessions:"
REDIS_SESSION_SECRET = "diet Dr.Pepper"
PORT = 3000

3. Spin up docker containers:

docker compose up -d

Option 2: Run using Node with Redis Cloud

1. Copy and rename the .env.example file

cp .env.example .env

2. Connect to Redis Cloud

Instead of a locally hosted Redis server, you can connect to a free Redis database on Redis Cloud.

If you don't yet have a database setup in Redis Cloud get started here for free.

To connect to a Redis Cloud database, log into the Redis Cloud console and find the following:

  1. The public endpoint (looks like redis-#####.####.us-region-2-#.ec2.redns.redis-cloud.com:#####)
  2. Your username (default is the default username, otherwise find the one you setup)
  3. Your password (either setup through Data Access Control, or available in the Security section of the database page).

3. Edit environment variables

Combine the above values into a connection string and put it in your .env. It should look something like the following:

REDIS_URL="redis://default:<password>@redis-#####.####.us-region-2-#.ec2.redns.redis-cloud.com:#####"
REDIS_SESSION_PREFIX = "sessions:"
REDIS_SESSION_SECRET = "diet Dr.Pepper"
PORT = 3000

4. Run the development server

npm install
# then
npm run dev

Project structure

cache-quest
├───public
│   ├───assets
│   │   ├───characters
│   │   ├───data
│   │   ├───dialog
│   │   ├───fx
│   │   ├───maps
│   │   ├───objects
│   │   └───ui
│   ├───lib
│   └───src
│       ├───entities
│       ├───scenes
│       ├───states
│       └───systems
│           └───skills
└───server
    └───components
        ├───gamestate
        ├───leaderboard
        └───playerstate

Credits

Producer: Rebekah Reddis
Developer: Chanh Tran
UI designer: Meghan Wittbrodt
Story Editor: Sylvia Ogweng

Character and environment art:
Pixel Frog
Szadi art.

About

Cache Quest is a browser game powered by Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages