📜 ⬆️ ⬇️

Jedi Escape: May the gyroscope arrive with you

In anticipation of the rush around the 7th Star Wars episode, Google launched a special thematic section on its website, www.google.com/starwars .

Particular attention is drawn to the browser arcade Jedi Escape (eng. Lightsaber Escape), launched as part of the Chrome Experience .



The game works in conjunction with Chrome / Safari on the desktop + Chrome / Safari on the smartphone, while the main game takes place in the desktop browser and the phone is used as a lightsaber to reflect blasters and parry shots in the manner of PlayStation Move.
')
The mobile browser uses the DeviceMotion API and DeviceOrientation API, synchronizing the position of the phone through WebSockets and WebRTC. Graphics on the desktop are rendered via WebGL and tree.js. The sound goes through the Web Audio API, and for the sake of completeness, the sound effects of the sword go through the speaker of the phone separately from the main game.

To heighten the wow effect, most of the page code is available in a non-focused form.

Start escape

Source: https://habr.com/ru/post/273395/


All Articles