This is not an officially supported Google product.
This repository hosts a simple platformer game that makes use of multiple windows and screens. It is intended as an API showcase to inspire and increase multi-screen awareness on the Web through a unique game experience. It exercises a variety of Web APIs, including:
- Window Management API: getScreenDetails(), cross-screen window placement.
- Popup Window APIs: open(), moveTo(), moveBy(), resizeTo(), focus(), close().
- <canvas>: drawing and transforms relative to multi-screen space.
- HTMLAudioElement/Audio: sound effects, with pre-loading.
- Gamepad API: buttons and axes.
Play here or host your own local clone:
$ git clone https://github.com/googlechromelabs/multi-window-platformer-game.git
$ cd multi-window-platformer-game
$ python -m http.server &
$ chrome -- "http://localhost:8000"
Goal of the game: Just move 🟥 to 🏁 through levels. Look for temporary hints at the bottom of each level's window.
- Contains a
GameContext
which stores a global list ofGameEntity
. - A
GameEntity
is owned by oneGameWindow
at a time. - The
GameController
controls the main logic update loop for each entity inGameContext
, and eachGameWindow
handles the drawing of allGameEntity
(owned and unowned) into its own window (canvas). - A
GameWindow
is responsible for updating all of its owned entities when the window is moved around by the player.
You can use the editor at tile-editor/index.html
if you want to design your own tiles for levels.
It has been tested for basic functionality and for gaming fun :-). Some bugs are expected.