Code Monkey home page Code Monkey logo

deception's Introduction

Running this:

  • Check out the git repo somewhere and cd into it.
  • npm install and wait for a while
  • npm run dev will start a webserver on http://localhost:8080

Playing around:

  • index.js is the entry point for the script (it gets loaded in at the end of index.html)
  • ES6 as a language is pretty cool: ES6 Features
  • THREE is loaded in from the static/ folder, documentation here: ThreeJS docs

Basics:

  • Globals are defined in Constants.js
  • Game is actually a GameThree object... will fix that someday
  • Game.load creates a bunch of ThreeJS objects that get added to Game.scene (a THREE.Scene())
  • Game.update gets called on every animation frame, effectively 60x per second. dt parameter is number of seconds elapsed since the last animation frame. So moving forward Vector3(0, 0, 1) * dt effectively says "move forward 1 game unit per second".
  • Game.camera can move around the same way that any object can, except it also has directionality
  • I wrote a Keyboard handler that I can easily use to track if a key is down or not (has some bugs)
  • The part that really made me understand this is that everything is just handled 16ms at a time. Basically every 16ms you figure out what needs to change and then change it.

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.