proxx

A game of proximity

  • 所有者: GoogleChromeLabs/proxx
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者GoogleChromeLabs/proxx
主編程語言TypeScript
編程語言JavaScript (語言數: 5)
平台
許可證Apache License 2.0
所有者活动
創建於2019-02-28 15:05:25
推送於2024-09-26 21:58:22
最后一次提交2020-11-19 16:57:45
發布數27
最新版本名稱v1.1.1 (發布於 2021-06-16 10:05:45)
第一版名稱v0.0.2 (發布於 2019-04-26 23:54:07)
用户参与
星數1.3k
關注者數30
派生數130
提交數525
已啟用問題?
問題數296
打開的問題數81
拉請求數182
打開的拉請求數47
關閉的拉請求數36
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?