Giter Site home page Giter Site logo

fuzzy-umbrella's Introduction

This is an implementation of the once-popular 3-D rendering technique known as raycasting which was famously featured in 1991's popular video game hit Wolfenstein 3D.

All of the rendering is carried out within a single 640x480 canvas at ~30 frames per second. The rendering at its core is basically comprised of vertical slices of texture-mapped walls at constant-Z and per-pixel rendered ceiling and floor textures. An offscreen frame buffer is utilized to optimize per-pixel rendering.

This little project was inspired by a video on YouTube posted by a fellow seasoned programmer who goes by the name 'javidx9.' You can follow this link to refer to his tutorial of ray-casting done entirely on a command-line window!

Setting up

Requirements

  • Node.js
  • ejs
  • express

After cloning the repository, navigate to the root folder and install the dependencies using npm.

$ npm install

Once all the dependencies are installed, you can start up an Express development server with:

$ npm run start

Controls

  • Use keys W and S on your keyboard to move forwards and backwards, respectively.

  • Key rotates player counter-clockwise, and key rotates player clockwise.

  • Use keys A and D to strafe left and right, respectively.

  • You may use either MSW*, or the keys E and Q to raise and lower the player, respectively.

  • Use keys and to look up and down, respectively.

  • You may use either LMB*, or SPACE to shoot.

  • Use ENTER to open/close doors.

  • You may also use the mouse* for free-look.

    * You should first click LMB on the canvas to activate mouse controls.

Live Demo

You can check out the live demo here!

Map Editor GUI

Coming soon...

Features include

  • AABB collision detection & resolution
  • Walking animation
  • Ability to look up & down
  • Player elevation
  • Texture-mapped walls, floors & ceiling
  • Alpha-blending
  • Skybox rendering for outdoors
  • Shading with depth
  • Doors
  • Mini-map display

TODOs

  • Diagonal walls
  • World-object sprites
  • Transparent walls
  • Pseudo portal-rendering

fuzzy-umbrella's People

Contributors

basil656552 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.