Giter VIP home page Giter VIP logo

maze's Introduction

Craig's maze explorer

A procedural generated maze with a movable particle that maps the maze with ray tracing.

https://craigsidcarlson.github.io/maze/

How to explore

Use the arrow keys to move around amd explore the maze. Refresh the page for a new maze.

Hold CTRL to cheat.

Maze generation

The maze is generated using a depth first search algorithm.

Ray tracing

You can explore the mazess with a small particle that emits rays in the fov. The fov is configurable in the code. The particle uses ray tracing to cast a point from the particle's location onto the closest wall, it casts two rays per degree within the fov. Once the section of the wall (boundary vector) has been seen it stays lite.

The particle cannot pass through wall. This is done by analyzing the center ray being cast and determines if the distance to that boundary vector is less than the particle's movement amount.

Future features

There is a lot more potential here:

  • Add ai to navigate it automatically (flocking maybe?)

Resources

https://www.youtube.com/watch?v=HyK_Q5rrcr4
https://www.youtube.com/watch?v=TOEi6T2mtHo
https://www.youtube.com/watch?v=vYgIKn7iDH8
https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
https://github.com/joshforisha/open-simplex-noise-js

maze's People

Contributors

craigsidcarlson avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.