Sitemap

JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

How to Make a JavaScript Roguelike Scroll

7 min readJun 8, 2022
Press enter or click to view image in full size
Photo by Mitchell Luo on Unsplash

Dungeons are more interesting when you don’t know what’s around the corner. In this tutorial, we will add scrolling to a type of game known as a roguelike, which has machine-generated levels. Below is an animation of the initial game, which displays the full dungeon map.

And below is an animation of the finished version with a smaller display that scrolls.

We will add our scrolling logic in three phases.

  • 1) make the game scroll at all times.
  • 2) make the game scroll only when the player is far enough from the center.
  • 3) make the game only show part of the map.

Getting Started

To build this feature, download the project zip from Github. Upon extracting it, you’ll find a project directory to…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web
Already have an account? Sign in
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Nevin Katz

Written by Nevin Katz

Developer at EDC. I write about web development and biology. Subscribe at https://buttondown.email/nevkatz for article roundups.

Responses (1)

Write a response

Hi there,
Great article, well done.
Keep it up with a good work. :)