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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?