Intro cinematic + attract video + filing scene (s00/s04), scenes v3, looping attract player
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
9ab4b2e285
commit
23086be3b7
@ -29,6 +29,7 @@ async function boot() {
|
|||||||
if (G.debug) { initDebug(); window.RSG = { G, input, vid }; }
|
if (G.debug) { initDebug(); window.RSG = { G, input, vid }; }
|
||||||
preload(G.data.scenes[G.data.start].clip);
|
preload(G.data.scenes[G.data.start].clip);
|
||||||
preload(G.data.scenes[G.data.start].death);
|
preload(G.data.scenes[G.data.start].death);
|
||||||
|
attractPlay();
|
||||||
addEventListener("keydown", onKey);
|
addEventListener("keydown", onKey);
|
||||||
initTouch();
|
initTouch();
|
||||||
requestAnimationFrame(tick);
|
requestAnimationFrame(tick);
|
||||||
@ -64,10 +65,17 @@ function playClip(url, onEnded) {
|
|||||||
const vid = () => vids[cur];
|
const vid = () => vids[cur];
|
||||||
|
|
||||||
// ---------- scene flow ----------
|
// ---------- scene flow ----------
|
||||||
|
function attractPlay() { // looping mood video behind the title screen
|
||||||
|
const v = playClip("clips/attract.mp4", null);
|
||||||
|
v.loop = true;
|
||||||
|
v.muted = true;
|
||||||
|
}
|
||||||
|
|
||||||
function startGame() {
|
function startGame() {
|
||||||
G.lives = G.data.meta.lives;
|
G.lives = G.data.meta.lives;
|
||||||
G.score = 0;
|
G.score = 0;
|
||||||
G.checkpoint = G.data.start;
|
G.checkpoint = G.data.start;
|
||||||
|
vids.forEach((v) => { v.muted = false; v.loop = false; });
|
||||||
$("attract").classList.add("hidden");
|
$("attract").classList.add("hidden");
|
||||||
playScene(G.data.start);
|
playScene(G.data.start);
|
||||||
}
|
}
|
||||||
@ -134,7 +142,7 @@ function toAttract() {
|
|||||||
$("msg").classList.add("hidden");
|
$("msg").classList.add("hidden");
|
||||||
$("hiscore").textContent = "HI-SCORE " + (localStorage.rsg_hiscore || 0);
|
$("hiscore").textContent = "HI-SCORE " + (localStorage.rsg_hiscore || 0);
|
||||||
$("attract").classList.remove("hidden");
|
$("attract").classList.remove("hidden");
|
||||||
vid().pause();
|
attractPlay();
|
||||||
G.state = "ATTRACT";
|
G.state = "ATTRACT";
|
||||||
}
|
}
|
||||||
function saveHi() {
|
function saveHi() {
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
"meta": {
|
"meta": {
|
||||||
"title": "RECORD STORE GUY",
|
"title": "RECORD STORE GUY",
|
||||||
"lives": 5,
|
"lives": 5,
|
||||||
"version": 2
|
"version": 3
|
||||||
},
|
},
|
||||||
"start": "s01",
|
"start": "s00",
|
||||||
"scenes": {
|
"scenes": {
|
||||||
"s01": {
|
"s01": {
|
||||||
"clip": "clips/s01_action.mp4",
|
"clip": "clips/s01_action.mp4",
|
||||||
@ -59,6 +59,29 @@
|
|||||||
"cue": true
|
"cue": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"onSuccess": "s04",
|
||||||
|
"checkpoint": false
|
||||||
|
},
|
||||||
|
"s00": {
|
||||||
|
"clip": "clips/intro.mp4",
|
||||||
|
"death": "clips/s01_death.mp4",
|
||||||
|
"windows": [],
|
||||||
|
"onSuccess": "s01",
|
||||||
|
"checkpoint": false
|
||||||
|
},
|
||||||
|
"s04": {
|
||||||
|
"clip": "clips/s04_action.mp4",
|
||||||
|
"death": "clips/s04_death.mp4",
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"t": [
|
||||||
|
6.0,
|
||||||
|
7.2
|
||||||
|
],
|
||||||
|
"input": "left",
|
||||||
|
"cue": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"onSuccess": "WIN",
|
"onSuccess": "WIN",
|
||||||
"checkpoint": false
|
"checkpoint": false
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user