Code Monkey home page Code Monkey logo

doom-lite's Introduction

'Doom Like' FPS Engine

This repo is a learning exercise in writing a simple retro style FPS engine, similar to Doom using nothing by JavaScript and WebGL.

It is not an attempt to implement the original Doom engine in JS, instead a fully polygon based 3D world is created & rendered using WebGL. The world (walls, floors, ceilings etc) consists of triangle meshes, and the items, monsters etc are draw using the 'bill-boarding' technique to inject 2D sprites into a 3D world.

Current features:

  • ๐ŸงŠ Full 3D geometry, including triangulated floors and ceilings
  • ๐Ÿ—บ๏ธ Custom levels loaded from JSON
  • ๐Ÿ–ผ๏ธ Doom style texture mapping
  • ๐Ÿชš Sectors with differing heights for floors & ceilings
  • ๐Ÿชจ Physics based collision detection
  • ๐Ÿšจ Multiple lights and coloured lighting
  • ๐Ÿƒโ€โ™‚๏ธ Animation for sprites

No bundling or compilation is required, it runs as a pure HTML & JS app, using modern ES6 modules.

Live Demo

Live demo version is here hosted on GitHub pages

Screenshots

screenshot screenshot screenshot screenshot

Running Locally

Run any HTTP server of your choice from the root directory of this repo, and browse to the URL serving this repo folder.

If you have Node installed, you can run:

make install-tools
make local-server

The makefile is your friend, simply run make for helpful text

$ make
 _          _       
| |__   ___| |_ __  
| '_ \ / _ \ | '_ \ 
| | | |  __/ | |_) |
|_| |_|\___|_| .__/ 
             |_|    
help                 ๐Ÿ’ฌ This help message :)
install-tools        ๐Ÿ”ฎ Install dev tools into project bin directory
lint                 ๐ŸŒŸ Lint & format check only, sets exit code on error
lint-fix             ๐Ÿ“ Lint & format, attempts to fix errors & modify code
local-server         ๐ŸŒ Start a local HTTP server for development

Controls

  • Move Forward - W / up-arrow
  • Move Back - S / down-arrow
  • Turn Right - D / right-arrow
  • Turn Left - A / left-arrow
  • Strafe Right - Q
  • Strafe Left - E
  • Look Up - R
  • Look Down - F

Debug Controls

  • FOV decrease - 1
  • FOV increase - 2
  • NOCLIP toggle - Insert
  • Move Up - Page Up (when NOCLIP is enabled)
  • Move Down - Page Down (when NOCLIP is enabled)

Included Libraries

Some libraries have been copied into the repo (within the lib folder), this has been done under the terms of the license they have been distributed under.

doom-lite's People

Contributors

benc-uk avatar

Stargazers

Mason Cusack avatar

Watchers

 avatar  avatar

Forkers

petrmuf

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.