Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aleksandrhovhannisyan/raycasting-js

Demo of 2D and 3D raycasting in JavaScript using an HTML canvas.
https://github.com/aleksandrhovhannisyan/raycasting-js

canvas demoscene gamedev javascript raycasting

Last synced: about 2 months ago
JSON representation

Demo of 2D and 3D raycasting in JavaScript using an HTML canvas.

Awesome Lists containing this project

README

        

# 2D and 3D Raycasting with JavaScript Canvas

> Demo of 2D and 3D raycasting using JavaScript and an HTML canvas.

[View live demo](https://raycasting-from-scratch.netlify.app/)

![A top-down 2D scene depicting the player as a black dot with a line pointing in the direction it is facing. A yellow cone of view in front of it intersects with walls.](./screenshot.png)

No libraries, all from scratch.

Resources/references:

- [Coding Challenge #145: 2D Raycasting ](https://www.youtube.com/watch?v=TOEi6T2mtHo)
- [Coding Challenge #146: Rendering Raycasting ](https://www.youtube.com/watch?v=vYgIKn7iDH8)

Inspired by one of [tsoding](https://www.twitch.tv/tsoding)'s streams where he implemented a 3D raycaster with canvas:

- [https://github.com/tsoding/raycasting](https://github.com/tsoding/raycasting)

## Running Locally

- Clone the repo.
- `cd src`
- `npx serve .`

View the app running at `localhost:3000`.