Skip to content
Snippets Groups Projects
Commit 5f22cc6a authored by Paolo Brasolin's avatar Paolo Brasolin
Browse files

refactor: #fe slight tutorial cleanup

parent 1d2f371b
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ const TEXT_STYLE: { ...@@ -22,7 +22,7 @@ const TEXT_STYLE: {
}; };
export interface TutorialStep { export interface TutorialStep {
setup: (scenescene: TutorialScene) => void; setup: (scene: TutorialScene) => void;
teardown: (scene: TutorialScene) => void; teardown: (scene: TutorialScene) => void;
} }
......
...@@ -4,13 +4,14 @@ import TutorialScene, { TutorialStep } from "./tutorial_scene"; ...@@ -4,13 +4,14 @@ import TutorialScene, { TutorialStep } from "./tutorial_scene";
import Critter from "./critter"; import Critter from "./critter";
import Spear from "./spear"; import Spear from "./spear";
import Foe from "./foe"; import Foe from "./foe";
import { FONTS } from "./assets";
interface TrialRoundOptions { interface TrialRoundOptions {
scene: TutorialScene; scene: TutorialScene;
words: string[]; words: string[];
initialDelay: number; initialDelay: number;
wordsDelay: number; wordsDelay: number;
fixedDuration: number | undefined; fixedDuration?: number;
} }
function trialRound({ function trialRound({
...@@ -89,6 +90,7 @@ export const STEPS: TutorialStep[] = [ ...@@ -89,6 +90,7 @@ export const STEPS: TutorialStep[] = [
"That's a mob of\nangry bunnies\n🢇 🐰💢", "That's a mob of\nangry bunnies\n🢇 🐰💢",
); );
scene.bucket.push(text); scene.bucket.push(text);
scene.time.addEvent({ scene.time.addEvent({
delay: 500, delay: 500,
repeat: 5, repeat: 5,
...@@ -144,7 +146,6 @@ export const STEPS: TutorialStep[] = [ ...@@ -144,7 +146,6 @@ export const STEPS: TutorialStep[] = [
"his (rubber) lances\nscare them away!\n🔫🤯", "his (rubber) lances\nscare them away!\n🔫🤯",
); );
scene.bucket.push(text); scene.bucket.push(text);
const bunnies = [];
scene.time.addEvent({ scene.time.addEvent({
delay: 500, delay: 500,
...@@ -155,9 +156,9 @@ export const STEPS: TutorialStep[] = [ ...@@ -155,9 +156,9 @@ export const STEPS: TutorialStep[] = [
scene.player.getBounds().left / 3, scene.player.getBounds().left / 3,
0, 0,
); );
bunnies.push(critter);
const spear = new Spear(scene, scene.player, critter); const spear = new Spear(scene, scene.player, critter);
const collider = scene.physics.add.overlap(spear, critter, () => { const collider = scene.physics.add.overlap(spear, critter, () => {
scene.physics.world.removeCollider(collider);
scene.sound.play("sfx_hi_beep"); scene.sound.play("sfx_hi_beep");
scene.updateScore(1); scene.updateScore(1);
}); });
...@@ -191,8 +192,8 @@ export const STEPS: TutorialStep[] = [ ...@@ -191,8 +192,8 @@ export const STEPS: TutorialStep[] = [
text: `Try! Type your name\nthen ${verb} ENTER ↩🔨`, text: `Try! Type your name\nthen ${verb} ENTER ↩🔨`,
positionY: scene.uiDimensions.cluesBounds.centerY, positionY: scene.uiDimensions.cluesBounds.centerY,
}); });
scene.bucket.push(text); scene.bucket.push(text);
scene.submitTranscription = (inputStatus) => { scene.submitTranscription = (inputStatus) => {
scene.userName = inputStatus.final; scene.userName = inputStatus.final;
scene.nextStep(); scene.nextStep();
...@@ -226,7 +227,7 @@ export const STEPS: TutorialStep[] = [ ...@@ -226,7 +227,7 @@ export const STEPS: TutorialStep[] = [
{ {
setup: (scene) => { setup: (scene) => {
const text = scene.createText({ const text = scene.createText({
text: "🡼 💪🏅\nGreat! You scored\na bunch of points", text: `🡼 💪🏅\nGreat! You scored\n${scene.score} points`,
positionY: scene.uiDimensions.cluesBounds.centerY, positionY: scene.uiDimensions.cluesBounds.centerY,
}); });
scene.bucket.push(text); scene.bucket.push(text);
...@@ -337,7 +338,7 @@ export const STEPS: TutorialStep[] = [ ...@@ -337,7 +338,7 @@ export const STEPS: TutorialStep[] = [
(p + h) * j + p + h * 0.5, (p + h) * j + p + h * 0.5,
letter + letter.toLocaleLowerCase(), letter + letter.toLocaleLowerCase(),
{ {
fontFamily: "UnifrakturMaguntia", fontFamily: FONTS.FRAK,
fontSize: `${h / 1.4}px`, fontSize: `${h / 1.4}px`,
testString: alphabet + alphabet.toLowerCase(), testString: alphabet + alphabet.toLowerCase(),
color: "#ffffff", color: "#ffffff",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment