#!/usr/bin/env bash
# Screenshots of the game for its web site (site/images/shots/): tools/site/shots.sh  (from the game's folder)
set -euo pipefail
cd "$(dirname "$0")/../../../.."
out=var/screenshots/site
shot() { # name frames scene params
  JUMPHP_GL=0 JUMPHP_SCENE="$3" JUMPHP_SCENE_PARAMS="$4" bin/jumphp shot open-lemmings "$2" "$out/$1.png" >/dev/null 2>&1 && echo "ok $1" || echo "FAILED $1"
}
# JUMPHP_GL=0: no software OpenGL (fast; the bloom is the only thing missing)
shot title 220 'App\Scene\TitleScene' '{}' &
shot levels 40 'App\Scene\LevelScene' '{}' &
wait
shot forest 1000 'App\Scene\PlayScene' '{"level":2,"auto":true}' &
shot cave 760 'App\Scene\PlayScene' '{"level":5,"auto":true}' &
wait
shot boom 583 'App\Scene\PlayScene' '{"level":6,"auto":true}' &
shot forge 640 'App\Scene\PlayScene' '{"level":8,"auto":true}' &
wait
shot night 1500 'App\Scene\PlayScene' '{"level":9,"auto":true}' &
shot stairs 1300 'App\Scene\PlayScene' '{"level":7,"auto":true}' &
wait
