This repository is an Edutictac-maintained fork/deployment of Google Blockly Games, a set of educational games that teach programming with Blockly blocks.
Production site:
- Edutictac deployment: https://blockly.edutictac.es/
- Upstream Blockly Games: https://blockly.games/
- Upstream developer docs: https://github.com/google/blockly-games/wiki
appengine/: static site files served in production.appengine/*.html: top-level game entry points, for examplemaze.html.appengine/<game>/: generated assets and per-game static files.appengine/<game>/index.html: Edutictac static-host redirect for/game/URLs.build/: build and compression scripts.json/andmessages.json: translation sources.Makefile: build targets for individual games and all games.deploy.sh: compiles and uploadsappengine/to the Edutictac server.
The Makefile expects these tools to be available:
svn
wget
java
pythonThe deployment script also requires rsync and SSH access to the Edutictac
server.
Build all games:
make gamesBuild a single game:
make maze
make dance
make musicThe generated bundles are written under appengine/<game>/generated/.
Deploy everything:
./deploy.shDeploy a single game:
./deploy.sh mazeThe script compiles the requested target, then uploads appengine/ to:
user@example.org:/srv/www/blockly/
Only Catalan, English, and Spanish generated message files are included during upload:
ca.js
en.js
es.js
The site registers appengine/sw.js (from common/boot.js) so it can be
installed on tablets and played offline. Two rules when deploying:
-
Bump the cache version in
appengine/sw.js(const CACHE = 'bg-vN';) on every deploy, otherwise returning visitors may keep stale HTML/JS. -
On nginx, serve the worker itself uncached so updates propagate quickly:
location = /sw.js { add_header Cache-Control "no-cache"; }
Only games the user has visited online are available offline (runtime cache).
Blockly's original App Engine layout uses top-level entry files such as
maze.html, while each game also has an asset directory with the same basename,
such as maze/.
On nginx static hosting, /maze/ resolves to the directory. If that directory
has no index.html, nginx returns 403 Forbidden. To keep both URL styles
working, this fork includes small redirect files:
appengine/dance/index.html
appengine/puzzle/index.html
appengine/maze/index.html
appengine/bird/index.html
appengine/turtle/index.html
appengine/movie/index.html
appengine/music/index.html
appengine/pond-tutor/index.html
appengine/pond-duck/index.html
Each redirect preserves the query string and hash, so:
https://blockly.edutictac.es/maze/?lang=en
loads:
https://blockly.edutictac.es/maze.html?lang=en
Do not remove these files unless nginx is changed to rewrite /game/ URLs to
/game.html.
After deployment, verify the public game URLs:
for game in dance puzzle maze bird turtle movie music pond-tutor pond-duck; do
curl -sS -o /dev/null -w "$game/ %{http_code}\n" \
"https://blockly.edutictac.es/$game/?lang=en"
doneExpected result:
dance/ 200
puzzle/ 200
maze/ 200
bird/ 200
turtle/ 200
movie/ 200
music/ 200
pond-tutor/ 200
pond-duck/ 200
Also check the direct .html entry points if a game fails to load:
curl -I "https://blockly.edutictac.es/maze.html?lang=en"- Keep changes scoped to this fork unless syncing intentionally from upstream.
- The production deployment is static nginx hosting, not Google App Engine.
- Avoid committing generated or downloaded dependencies unless they are already part of the repository's expected layout.