GithubHelp home page GithubHelp logo

isabella232 / proxx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlechromelabs/proxx

0.0 0.0 0.0 2.95 MB

A game of proximity

Home Page: https://proxx.app

License: Apache License 2.0

JavaScript 12.67% TypeScript 72.06% HTML 1.83% CSS 9.70% GLSL 3.75%

proxx's Introduction

PROXX

proxx-social-blue-v2 0

This is the repository for PROXX - a game built for every device with a web browser (including feature phones!)

About this repository

The app is built with Preact for UI components, PostCSS for styles, Comlink for handling web workers and uses Rollup to bundle it all up.

There are three main directories:

  • /src/services
  • /src/rendering
  • /src/gamelogic

/src/services

Originally, we had a service-based architecture. Over time, the code evolved to two main services: The UI service (preact-canvas) and the state service.

/src/rendering

The app has two rendering modes. One backed by WebGL and one backed by Canvas 2D (webgl-renderer and canvas-2d-renderer). Each renderer can be plugged into an animator — one that uses motion and one that doesn’t use motion. In reality, however, the WebGL renderer is only ever used with the motion animator, and the Canvas 2D renderer is only ever used for no motion.

We generate all the sprites for our animations in the background at load time and store them in IndexedDB.

/src/gamelogic

This is the pure game logic for the app. The game logic is run inside of a web worker through the state service to keep the main thread as free as possible for animation work.

Debugging flag

There are few flags you can set as URL query parameter for debugging purposes:

  • prerender: Load the app in prerender mode (used for building the static index.html).
  • debug: Turn on controls for the Nebula animation.
  • no-cache: Bypass ServiceWorker and IndexedDB caches.
  • cell-focus: Start the game with mouse & key forcus enabled.
  • motion=0: Start the game in no animation mode.
  • motion=1: Start the game in animation mode.

Building locally

Clone the repository, then:

npm install
npm run build

You can run the development server with:

npm run serve

Format the code with prettier and tslint before commit:

npm run fmt

proxx's People

Contributors

andreban avatar bubersson avatar developit avatar ianvollick avatar jakearchibald avatar kaykayehnn avatar kosamari avatar lucacasonato avatar mathiasbynens avatar mnordine avatar paulkinlan avatar surma avatar timvdlippe avatar tjenkinson avatar tomayac 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.