From 738e6ff9d530037cf12cfcbaa83a7f99683ddef1 Mon Sep 17 00:00:00 2001 From: Kiver Teixeira Date: Sun, 27 Sep 2026 12:54:18 -0300 Subject: [PATCH 1/8] feat(visual): apply approved brand to game runtime --- scripts/build-games.mjs | 2 +- src/common/base-scene.js | 52 +++++++++++++++++++------------ src/runtime/brand.js | 67 +++++++++++++++++----------------------- 3 files changed, 62 insertions(+), 59 deletions(-) diff --git a/scripts/build-games.mjs b/scripts/build-games.mjs index 36d23531..7e8982fd 100644 --- a/scripts/build-games.mjs +++ b/scripts/build-games.mjs @@ -22,7 +22,7 @@ const phaser = fs.readFileSync(path.join(root, 'vendor/phaser.min.js'), 'utf8'); const three = fs.readFileSync(path.join(root, 'vendor/three.bundle.min.js'), 'utf8'); const css = ` -*{box-sizing:border-box}html,body,#game{width:100%;height:100%;margin:0;overflow:hidden}body{font-family:Inter,ui-rounded,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f7f6f2;color:#242523}canvas{display:block;touch-action:none}.three-ui{position:absolute;z-index:3;left:0;right:0;top:0;padding:20px 28px;pointer-events:none;text-align:center}.three-brand{position:absolute;left:22px;top:14px}.aprincar-game-lockup{display:flex;align-items:center;gap:8px;color:#2563eb;font:900 18px/1 ui-rounded,"Arial Rounded MT Bold","Trebuchet MS",Inter,system-ui,sans-serif}.aprincar-game-lockup svg{width:36px;height:36px;display:block}.aprincar-game-wordmark{display:inline-flex;letter-spacing:-.04em}.three-ui #three-level{position:absolute;right:26px;top:23px;color:#2563eb;font-weight:800}.three-ui h1{margin:28px auto 4px;font-size:clamp(24px,4vw,36px)}.three-ui p{margin:0;color:#6f716d;font-weight:700}#three-canvas{width:100%;height:100%}@media(max-width:600px){.three-ui{padding:12px 14px}.three-brand{left:12px;top:10px}.aprincar-game-lockup{font-size:14px;gap:5px}.aprincar-game-lockup svg{width:28px;height:28px}.three-ui #three-level{right:14px;top:15px;font-size:13px}.three-ui h1{margin:48px auto 4px;font-size:clamp(22px,7vw,30px);max-width:82vw}.three-ui p{font-size:13px;max-width:88vw;margin:0 auto;line-height:1.3}}@media(orientation:landscape) and (max-height:560px){.three-ui h1{margin:24px auto 2px}.three-ui p{font-size:12px}}`; +*{box-sizing:border-box}html,body,#game{width:100%;height:100%;margin:0;overflow:hidden}body{font-family:"Poppins",Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f8fbff;color:#14213f}canvas{display:block;touch-action:none}.three-ui{position:absolute;z-index:3;left:0;right:0;top:0;padding:20px 28px;pointer-events:none;text-align:center}.three-brand{position:absolute;left:22px;top:14px}.aprincar-game-lockup{display:flex;align-items:center;gap:8px;color:#2563eb;font:800 18px/1 "Poppins",Inter,system-ui,sans-serif}.aprincar-game-lockup svg{width:36px;height:36px;display:block}.aprincar-game-wordmark{display:inline-flex;letter-spacing:-.04em}.three-ui #three-level{position:absolute;right:26px;top:23px;color:#2563eb;font-weight:800}.three-ui h1{margin:28px auto 4px;font-size:clamp(24px,4vw,36px)}.three-ui p{margin:0;color:#6f716d;font-weight:700}#three-canvas{width:100%;height:100%}@media(max-width:600px){.three-ui{padding:12px 14px}.three-brand{left:12px;top:10px}.aprincar-game-lockup{font-size:14px;gap:5px}.aprincar-game-lockup svg{width:28px;height:28px}.three-ui #three-level{right:14px;top:15px;font-size:13px}.three-ui h1{margin:48px auto 4px;font-size:clamp(22px,7vw,30px);max-width:82vw}.three-ui p{font-size:13px;max-width:88vw;margin:0 auto;line-height:1.3}}@media(orientation:landscape) and (max-height:560px){.three-ui h1{margin:24px auto 2px}.three-ui p{font-size:12px}}`; for (const game of games) { const dir = path.join(gamesDir, game.slug); diff --git a/src/common/base-scene.js b/src/common/base-scene.js index a046b510..92752a4d 100644 --- a/src/common/base-scene.js +++ b/src/common/base-scene.js @@ -4,15 +4,15 @@ const BRAND = window.APRINCAR_BRAND; const FONT = BRAND.fontFamily; const C = { - bg: 0xf7f6f2, - purple: 0x8b5cf6, + bg: 0xf8fbff, + purple: 0x7c3aed, blue: 0x2563eb, - coral: 0xf43f5e, - orange: 0xfb923c, - sun: 0xfbcb24, - leaf: 0x22c55e, - sky: 0x38bdf8, - ink: '#13203d', + coral: 0xef4444, + orange: 0xf59e0b, + sun: 0xfbbf24, + leaf: 0x10b981, + sky: 0x0ea5e9, + ink: '#14213f', white: 0xffffff }; @@ -45,7 +45,8 @@ } createChrome() { - this.headerBackground = this.add.rectangle(0, 0, 1, 1, C.white).setStrokeStyle(1, 0xe2dfd7); + this.headerShadow = this.add.rectangle(0, 0, 1, 1, 0x0f172a, 0.06); + this.headerBackground = this.add.rectangle(0, 0, 1, 1, C.white).setStrokeStyle(1, 0xdce8f7); BRAND.addPhaser(this, this.mobileFirst ? 14 : 22, this.mobileFirst ? 14 : 16); this.titleText = this.add.text(0, 0, CFG.name, { @@ -58,9 +59,9 @@ this.levelText = this.add.text(0, 0, 'Fase 1', { fontFamily: FONT, - fontSize: this.mobileFirst ? '15px' : '18px', + fontSize: this.mobileFirst ? '14px' : '17px', fontStyle: 'bold', - color: '#6f5bd7' + color: '#2563EB' }).setOrigin(1, 0); this.promptText = this.add.text(0, 0, '', { @@ -75,15 +76,15 @@ fontFamily: FONT, fontSize: this.mobileFirst ? '17px' : '22px', fontStyle: 'bold', - color: '#5143a6', + color: '#2563EB', align: 'center' }).setOrigin(0.5); - this.starText = this.add.text(0, 0, '⭐ 0', { + this.starText = this.add.text(0, 0, '★ 0', { fontFamily: FONT, fontSize: this.mobileFirst ? '17px' : '22px', fontStyle: 'bold', - color: '#6f5bd7' + color: '#F59E0B' }); this.layoutChrome(); @@ -102,6 +103,9 @@ const layout = window.AprincarLayout.metrics(this); this.layout = layout; + this.headerShadow + .setPosition(layout.header.x, layout.header.y + 3) + .setSize(layout.header.width, layout.header.height); this.headerBackground .setPosition(layout.header.x, layout.header.y) .setSize(layout.header.width, layout.header.height); @@ -157,19 +161,27 @@ h = Math.max(h, minimum); } - const box = this.add.rectangle(x, y, w, h, color) - .setStrokeStyle(2, 0xe2dfd7) - .setInteractive({ useHandCursor: true }); + const shadow = this.add.graphics(); + shadow.fillStyle(0x0f172a, 0.08); + shadow.fillRoundedRect(x - w / 2, y - h / 2 + 4, w, h, Math.min(18, h / 3)); + + const visual = this.add.graphics(); + visual.fillStyle(color, 1); + visual.fillRoundedRect(x - w / 2, y - h / 2, w, h, Math.min(18, h / 3)); + visual.lineStyle(2, color === C.white ? 0xdce8f7 : color, 1); + visual.strokeRoundedRect(x - w / 2, y - h / 2, w, h, Math.min(18, h / 3)); + const box = this.add.rectangle(x, y, w, h, 0xffffff, 0.001).setInteractive({ useHandCursor: true }); + const isYellow = color === C.sun || color === C.orange; const text = this.add.text(x, y, label, { fontFamily: FONT, - fontSize: `${Math.min(this.mobileFirst ? 28 : 34, h * 0.44)}px`, + fontSize: `${Math.min(this.mobileFirst ? 26 : 32, h * 0.40)}px`, fontStyle: 'bold', - color: color === C.white ? C.ink : '#ffffff', + color: color === C.white || isYellow ? C.ink : '#ffffff', align: 'center' }).setOrigin(0.5); - this.roundGroup.add([box, text]); + this.roundGroup.add([shadow, visual, box, text]); this.target(kind === 'action' ? label : value, x, y, w, h, kind); box.on('pointerup', () => this.choose(value, box)); return box; diff --git a/src/runtime/brand.js b/src/runtime/brand.js index 554e30e1..870829a6 100644 --- a/src/runtime/brand.js +++ b/src/runtime/brand.js @@ -1,47 +1,44 @@ (() => { const colors = Object.freeze({ - blue: '#4F6EF7', - blueStrong: '#3B55D9', - sun: '#FFC83D', - orange: '#FF9F43', - leaf: '#2FC98F', - coral: '#FF6B6B', - purple: '#8B6FF7', - navy: '#17213D', - ink: '#20263A', + blue: '#2563EB', + blueStrong: '#1D4ED8', + secondary: '#0EA5E9', + sun: '#FBBF24', + orange: '#F59E0B', + leaf: '#10B981', + coral: '#EF4444', + purple: '#7C3AED', + navy: '#0F172A', + ink: '#14213F', }); - const markSvg = ``; + const markSvg = ``; + const wordmark = `Aprincar`; + const lockupHtml = `${markSvg}${wordmark}`; + const fontFamily = '"Poppins",Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif'; - const wordmark = - `Aprincar`; - - const lockupHtml = - `${markSvg}${wordmark}`; - - const fontFamily = - 'ui-rounded,"Arial Rounded MT Bold","Trebuchet MS",Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif'; - - function addPhaser(scene, x = 26, y = 16) { + function addPhaser(scene, x = 18, y = 12) { const mark = scene.add.container(x, y); const glyph = scene.add.graphics(); - glyph.fillStyle(0x4f6ef7, 1); - glyph.fillTriangle(3, 36, 20, 3, 38, 36); + glyph.lineStyle(9, 0x2563eb, 1); + glyph.beginPath(); + glyph.moveTo(3, 37); + glyph.lineTo(13, 10); + glyph.quadraticBezierTo(20, -1, 27, 10); + glyph.lineTo(38, 37); + glyph.strokePath(); - glyph.fillStyle(0xffffff, 1); - glyph.fillTriangle(17, 14, 17, 29, 30, 21.5); + glyph.fillStyle(0xfbbf24, 1); + glyph.fillTriangle(17, 15, 17, 31, 30, 23); - glyph.fillStyle(0xffc83d, 1); - glyph.fillCircle(35, 6, 5); - - const apr = scene.add.text(47, 7, 'Apr', { + const apr = scene.add.text(48, 6, 'Apr', { fontFamily, fontSize: '18px', fontStyle: 'bold', color: colors.navy, }); - const incar = scene.add.text(47 + apr.width - 1, 7, 'incar', { + const incar = scene.add.text(47 + apr.width, 6, 'incar', { fontFamily, fontSize: '18px', fontStyle: 'bold', @@ -49,15 +46,9 @@ }); mark.add([glyph, apr, incar]); - mark.setData('brandVersion', 4); + mark.setData('brandVersion', 'approved-v1'); return mark; } - window.APRINCAR_BRAND = Object.freeze({ - colors, - fontFamily, - markSvg, - lockupHtml, - addPhaser, - }); -})(); + window.APRINCAR_BRAND = Object.freeze({ colors, fontFamily, markSvg, lockupHtml, addPhaser }); +})(); \ No newline at end of file From 02bac0accd1f25604cee2c6fe8546c0447ec57ab Mon Sep 17 00:00:00 2001 From: Kiver Teixeira Date: Sun, 27 Sep 2026 12:55:35 -0300 Subject: [PATCH 2/8] feat(visual): refine fruit animal and basket artwork --- src/common/vector-art.js | 128 ++++++++++++++++++++-------------- src/games/counting-animals.js | 4 +- src/games/fruit-basket.js | 32 ++++----- 3 files changed, 89 insertions(+), 75 deletions(-) diff --git a/src/common/vector-art.js b/src/common/vector-art.js index 1d9d5fbe..1ae7cd37 100644 --- a/src/common/vector-art.js +++ b/src/common/vector-art.js @@ -5,14 +5,20 @@ window.AprincarVectorArt = (() => { drawAnimal(graphics, type, x, y, size = 64) { graphics.save(); const s = size / 64; + graphics.fillStyle(0x0f172a, 0.10); + graphics.fillEllipse(x + 2 * s, y + 28 * s, 46 * s, 10 * s); if (type === 'lion' || type === 'leao') { - // Juba - graphics.fillStyle(0xd97706, 1); - graphics.fillCircle(x, y, 32 * s); + // Juba com profundidade + graphics.fillStyle(0xb85b12, 1); + graphics.fillCircle(x, y, 33 * s); + graphics.fillStyle(0xde7b18, 1); + graphics.fillCircle(x, y - 2 * s, 29 * s); // Cabeça - graphics.fillStyle(0xfbbf24, 1); + graphics.fillStyle(0xf7b934, 1); graphics.fillCircle(x, y, 22 * s); + graphics.fillStyle(0xffd765, 0.82); + graphics.fillEllipse(x - 6 * s, y - 7 * s, 18 * s, 12 * s); // Orelhas graphics.fillStyle(0xd97706, 1); graphics.fillCircle(x - 18 * s, y - 18 * s, 8 * s); @@ -159,65 +165,79 @@ window.AprincarVectorArt = (() => { graphics.restore(); }, - // Draw Realistic Tasty Fruits + // Approved glossy fruit set used by counting and classification games. drawFruit(graphics, type, x, y, size = 56) { graphics.save(); const s = size / 56; + const shadow = (w = 38, h = 9) => { + graphics.fillStyle(0x0f172a, 0.11); + graphics.fillEllipse(x + 2 * s, y + 23 * s, w * s, h * s); + }; + const shine = (dx = -9, dy = -9, w = 7, h = 10) => { + graphics.fillStyle(0xffffff, 0.42); + graphics.fillEllipse(x + dx * s, y + dy * s, w * s, h * s); + }; + const leaf = (dx = 7, dy = -22, rot = -0.35) => { + graphics.save(); + graphics.translateCanvas(x + dx * s, y + dy * s); + graphics.rotateCanvas(rot); + graphics.fillStyle(0x22a447, 1); + graphics.fillEllipse(0, 0, 12 * s, 6 * s); + graphics.restore(); + }; if (type === 'apple' || type === 'maca') { - // Maçã Vermelha - graphics.fillStyle(0x15803d, 1); - graphics.fillEllipse(x + 6 * s, y - 22 * s, 8 * s, 5 * s); // Folha - graphics.fillStyle(0x78350f, 1); - graphics.fillRect(x - 1.5 * s, y - 24 * s, 3 * s, 8 * s); // Cabinho - graphics.fillStyle(0xef4444, 1); - graphics.fillCircle(x - 8 * s, y - 2 * s, 16 * s); - graphics.fillCircle(x + 8 * s, y - 2 * s, 16 * s); - graphics.fillCircle(x, y + 6 * s, 15 * s); - // Brilho - graphics.fillStyle(0xffffff, 0.45); - graphics.fillEllipse(x - 10 * s, y - 8 * s, 5 * s, 8 * s); + shadow(42, 9); + graphics.fillStyle(0x7c2d12, 1); graphics.fillRect(x - 2 * s, y - 25 * s, 4 * s, 10 * s); + leaf(); + graphics.fillStyle(0xd92e3d, 1); graphics.fillCircle(x - 8 * s, y - 1 * s, 17 * s); graphics.fillCircle(x + 8 * s, y - 1 * s, 17 * s); + graphics.fillStyle(0xf04450, 1); graphics.fillCircle(x, y + 7 * s, 16 * s); + shine(-10,-8,7,11); } else if (type === 'banana') { - // Banana Amarela - graphics.lineStyle(16 * s, 0xfacc15, 1); - graphics.beginPath(); - graphics.arc(x + 10 * s, y - 10 * s, 26 * s, 1.2, 2.7); - graphics.strokePath(); - graphics.fillStyle(0x713f12, 1); - graphics.fillCircle(x - 14 * s, y + 12 * s, 3 * s); // Ponta - graphics.fillCircle(x + 22 * s, y - 16 * s, 4 * s); // Topo + shadow(46, 8); + graphics.lineStyle(19 * s, 0xe6a915, 1); graphics.beginPath(); graphics.arc(x + 7 * s, y - 8 * s, 29 * s, 1.05, 2.75); graphics.strokePath(); + graphics.lineStyle(13 * s, 0xffdf36, 1); graphics.beginPath(); graphics.arc(x + 7 * s, y - 9 * s, 28 * s, 1.05, 2.75); graphics.strokePath(); + graphics.lineStyle(4 * s, 0xfff19a, 0.8); graphics.beginPath(); graphics.arc(x + 4 * s, y - 12 * s, 25 * s, 1.18, 2.45); graphics.strokePath(); + graphics.fillStyle(0x713f12,1); graphics.fillCircle(x-17*s,y+13*s,3*s); graphics.fillCircle(x+24*s,y-18*s,4*s); } else if (type === 'orange' || type === 'laranja') { - // Laranja - graphics.fillStyle(0x16a34a, 1); - graphics.fillEllipse(x + 5 * s, y - 20 * s, 9 * s, 5 * s); // Folha - graphics.fillStyle(0x78350f, 1); - graphics.fillRect(x - 1.5 * s, y - 20 * s, 3 * s, 6 * s); // Cabinho - graphics.fillStyle(0xf97316, 1); - graphics.fillCircle(x, y, 20 * s); - graphics.fillStyle(0xfbbf24, 0.4); - graphics.fillCircle(x - 6 * s, y - 6 * s, 8 * s); + shadow(); leaf(8,-21,-0.2); + graphics.fillStyle(0xe96c10,1); graphics.fillCircle(x,y,21*s); + graphics.fillStyle(0xff861c,1); graphics.fillCircle(x-2*s,y-2*s,19*s); + shine(-7,-8,8,10); + graphics.fillStyle(0xfbbf24,0.36); for(const [dx,dy] of [[8,-5],[11,5],[-2,11]]) graphics.fillCircle(x+dx*s,y+dy*s,1.2*s); } else if (type === 'strawberry' || type === 'morango') { - // Morango - graphics.fillStyle(0xdc2626, 1); - graphics.fillTriangle(x - 16 * s, y - 10 * s, x + 16 * s, y - 10 * s, x, y + 20 * s); - graphics.fillCircle(x, y - 6 * s, 16 * s); - // Folhas verdes no topo - graphics.fillStyle(0x16a34a, 1); - graphics.fillTriangle(x - 12 * s, y - 16 * s, x - 4 * s, y - 8 * s, x, y - 20 * s); - graphics.fillTriangle(x + 12 * s, y - 16 * s, x + 4 * s, y - 8 * s, x, y - 20 * s); - // Sementinhas douradas - graphics.fillStyle(0xfef08a, 0.9); - graphics.fillCircle(x - 6 * s, y - 2 * s, 1.2 * s); - graphics.fillCircle(x + 6 * s, y - 2 * s, 1.2 * s); - graphics.fillCircle(x, y + 5 * s, 1.2 * s); - graphics.fillCircle(x - 5 * s, y + 8 * s, 1.2 * s); - graphics.fillCircle(x + 5 * s, y + 8 * s, 1.2 * s); + shadow(36,8); + graphics.fillStyle(0xd92735,1); graphics.fillCircle(x,y-7*s,17*s); graphics.fillTriangle(x-16*s,y-5*s,x+16*s,y-5*s,x,y+24*s); + graphics.fillStyle(0xf13b48,1); graphics.fillCircle(x-3*s,y-8*s,14*s); shine(-9,-11,6,8); + graphics.fillStyle(0x22a447,1); + graphics.fillTriangle(x-15*s,y-15*s,x-3*s,y-8*s,x-6*s,y-24*s); graphics.fillTriangle(x+15*s,y-15*s,x+3*s,y-8*s,x+6*s,y-24*s); graphics.fillTriangle(x-7*s,y-17*s,x+7*s,y-17*s,x,y-26*s); + graphics.fillStyle(0xffdc63,1); for(const [dx,dy] of [[-8,-2],[7,-1],[-4,7],[5,9],[0,16]]) graphics.fillCircle(x+dx*s,y+dy*s,1.4*s); + } else if (type === 'grape' || type === 'uva') { + shadow(40,8); leaf(9,-24,-0.35); + const pts=[[-10,-10],[2,-13],[13,-7],[-13,2],[0,0],[12,5],[-6,12],[7,15]]; + pts.forEach(([dx,dy],i)=>{graphics.fillStyle(i%2?0x7c3aed:0x9333ea,1);graphics.fillCircle(x+dx*s,y+dy*s,9*s);}); + shine(-14,-14,5,6); + } else if (type === 'pear' || type === 'pera') { + shadow(36,8); graphics.fillStyle(0x6b3d12,1);graphics.fillRect(x-1*s,y-26*s,3*s,9*s);leaf(7,-24,-.3); + graphics.fillStyle(0x79bf19,1);graphics.fillCircle(x,y+7*s,18*s);graphics.fillEllipse(x,y-8*s,14*s,20*s);graphics.fillStyle(0xa4dd24,.75);graphics.fillEllipse(x-5*s,y-5*s,11*s,22*s);shine(-8,-10,5,9); + } else if (type === 'watermelon' || type === 'melancia') { + shadow(44,8); graphics.fillStyle(0x17853e,1); graphics.fillTriangle(x-25*s,y+17*s,x+24*s,y+17*s,x+19*s,y-18*s); + graphics.fillStyle(0xf8f2d0,1);graphics.fillTriangle(x-21*s,y+13*s,x+20*s,y+13*s,x+16*s,y-14*s); + graphics.fillStyle(0xf04755,1);graphics.fillTriangle(x-18*s,y+10*s,x+17*s,y+10*s,x+13*s,y-11*s); + graphics.fillStyle(0x3f1d18,1);for(const [dx,dy] of [[-8,2],[2,5],[8,-1]]) graphics.fillEllipse(x+dx*s,y+dy*s,2*s,4*s); + } else if (type === 'pineapple' || type === 'abacaxi') { + shadow(34,8);graphics.fillStyle(0xf3a91a,1);graphics.fillEllipse(x,y+4*s,17*s,23*s); + graphics.lineStyle(2*s,0xd58012,.7);for(let d=-12;d<=12;d+=8){graphics.lineBetween(x-14*s,y+(d-4)*s,x+14*s,y+(d+12)*s);graphics.lineBetween(x+14*s,y+(d-4)*s,x-14*s,y+(d+12)*s);} + graphics.fillStyle(0x22a447,1);for(const dx of [-10,-5,0,5,10]) graphics.fillTriangle(x,y-18*s,x+dx*s,y-38*s,x+(dx+5)*s,y-17*s); + } else if (type === 'mango' || type === 'manga') { + shadow(39,8);leaf(8,-21,-.2);graphics.fillStyle(0xf59e0b,1);graphics.fillEllipse(x,y+2*s,20*s,24*s);graphics.fillStyle(0xffbf35,.9);graphics.fillEllipse(x-6*s,y-4*s,14*s,20*s);graphics.fillStyle(0xef4444,.45);graphics.fillEllipse(x+9*s,y-6*s,8*s,14*s);shine(-9,-9,5,8); + } else if (type === 'kiwi') { + shadow(36,8);graphics.fillStyle(0x8b5a2b,1);graphics.fillCircle(x,y,21*s);graphics.fillStyle(0x78c82f,1);graphics.fillCircle(x,y,17*s);graphics.fillStyle(0xfff6c5,1);graphics.fillEllipse(x,y,7*s,9*s);graphics.fillStyle(0x2b1b0f,1);for(let i=0;i<10;i++){const a=i*Math.PI/5;graphics.fillEllipse(x+Math.cos(a)*11*s,y+Math.sin(a)*11*s,1.2*s,2.2*s);} + shine(-7,-9,5,7); } else { - // Uva - graphics.fillStyle(0x8b5cf6, 1); - graphics.fillCircle(x - 7 * s, y - 6 * s, 8 * s); - graphics.fillCircle(x + 7 * s, y - 6 * s, 8 * s); - graphics.fillCircle(x, y + 4 * s, 8 * s); + this.drawFruit(graphics, 'grape', x, y, size); + graphics.restore(); + return; } graphics.restore(); }, diff --git a/src/games/counting-animals.js b/src/games/counting-animals.js index 4615d324..73d90cf0 100644 --- a/src/games/counting-animals.js +++ b/src/games/counting-animals.js @@ -36,7 +36,7 @@ }; const savannaBg = this.add.graphics(); - savannaBg.fillStyle(0xfef3c7, 0.42); + savannaBg.fillStyle(0xfffbeb, 1); savannaBg.fillRoundedRect( animalArea.left, animalArea.top, @@ -44,7 +44,7 @@ animalArea.height, 20 ); - savannaBg.lineStyle(2, 0xfde68a, 0.85); + savannaBg.lineStyle(2, 0xf7d86b, 0.8); savannaBg.strokeRoundedRect( animalArea.left, animalArea.top, diff --git a/src/games/fruit-basket.js b/src/games/fruit-basket.js index 10513585..8a696089 100644 --- a/src/games/fruit-basket.js +++ b/src/games/fruit-basket.js @@ -1,7 +1,7 @@ // Cesta de Frutas — Feira da Cesta (() => { const { C, FONT } = window.AprincarConstants; - const FRUIT_TYPES = ['apple', 'orange', 'strawberry', 'banana']; + const FRUIT_TYPES = ['apple', 'banana', 'grape', 'orange', 'pear', 'strawberry', 'watermelon', 'pineapple', 'mango', 'kiwi']; class FruitBasketScene extends window.AprincarBaseScene { nextRound() { @@ -47,23 +47,15 @@ const basketContainer = this.add.container(stage.centerX, basketY); const basketGfx = this.add.graphics(); - basketGfx.fillStyle(0xc98749, 1); - basketGfx.fillRoundedRect( - -basketWidth / 2, - -basketHeight / 2, - basketWidth, - basketHeight, - 16 - ); - basketGfx.lineStyle(4, 0x8f5b2c, 1); - basketGfx.strokeRoundedRect( - -basketWidth / 2, - -basketHeight / 2, - basketWidth, - basketHeight, - 16 - ); - basketGfx.lineStyle(2, 0x8f5b2c, 0.4); + basketGfx.fillStyle(0x0f172a, 0.10); + basketGfx.fillEllipse(0, basketHeight * 0.48, basketWidth * 0.9, basketHeight * 0.24); + basketGfx.fillStyle(0x9a5a27, 1); + basketGfx.fillRoundedRect(-basketWidth / 2, -basketHeight / 2, basketWidth, basketHeight, 22); + basketGfx.fillStyle(0xc9823c, 1); + basketGfx.fillRoundedRect(-basketWidth / 2 + 5, -basketHeight / 2 + 5, basketWidth - 10, basketHeight - 10, 18); + basketGfx.fillStyle(0xe0a55e, 0.72); + basketGfx.fillRoundedRect(-basketWidth / 2 + 9, -basketHeight / 2 + 10, basketWidth - 18, 15, 8); + basketGfx.lineStyle(3, 0x9a5a27, 0.72); for ( let x = -basketWidth / 2 + 28; x <= basketWidth / 2 - 28; @@ -81,7 +73,9 @@ fontFamily: FONT, fontSize: layout.portrait ? '36px' : '42px', fontStyle: 'bold', - color: '#ffffff' + color: '#ffffff', + stroke: '#8b4f20', + strokeThickness: 2 }).setOrigin(0.5); basketContainer.add([basketGfx, this.counter]); From fec4722a0426eb9476f33e735608bd710dcfb2a7 Mon Sep 17 00:00:00 2001 From: Kiver Teixeira Date: Sun, 27 Sep 2026 12:56:38 -0300 Subject: [PATCH 3/8] test(visual): lock approved game identity and fruit set --- tests/brand.test.mjs | 2 +- tests/runtime-quality.test.mjs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/brand.test.mjs b/tests/brand.test.mjs index 954953a6..4345deba 100644 --- a/tests/brand.test.mjs +++ b/tests/brand.test.mjs @@ -2,7 +2,7 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import fs from 'node:fs'; -test('official game runtimes consume Aprincar Brand System v4 portal identity', () => { +test('official game runtimes consume the locked approved Aprincar identity', () => { const brand = fs.readFileSync(new URL('../src/runtime/brand.js', import.meta.url), 'utf8'); const phaser = fs.readFileSync(new URL('../src/runtime/phaser-runtime.js', import.meta.url), 'utf8'); const three = fs.readFileSync(new URL('../src/runtime/three-runtime.js', import.meta.url), 'utf8'); diff --git a/tests/runtime-quality.test.mjs b/tests/runtime-quality.test.mjs index b06f6f55..19eea889 100644 --- a/tests/runtime-quality.test.mjs +++ b/tests/runtime-quality.test.mjs @@ -47,7 +47,7 @@ test('Three.js distinguishes drag using total pointer distance and does not shuf }); -test('game runtime uses Aprincar portal brand v4 without the legacy star identity', () => { +test('game runtime uses the locked approved Aprincar identity', () => { assert.match(brand, /data-brand-version="4"/); assert.match(brand, /aprincar-portal/); assert.match(brand, /#4F6EF7/i); @@ -95,3 +95,13 @@ test('guided painting pairs color with symbols and exposes large paint regions', assert.match(guidedPaintingSource, /symbol/); assert.match(guidedPaintingSource, /Conferir pintura/); }); + + +test('approved game artwork exposes the complete fruit set without emoji fallbacks', () => { + const vectorArt = fs.readFileSync(new URL('../src/common/vector-art.js', import.meta.url), 'utf8'); + for (const fruit of ['apple','banana','grape','orange','pear','strawberry','watermelon','pineapple','mango','kiwi']) { + assert.match(vectorArt, new RegExp(`type === ['"]${fruit}['"]|type === ['"][^'"]+['"] \\|\\| type === ['"]${fruit}['"]`)); + } + assert.match(vectorArt, /Approved glossy fruit set/); + assert.match(fruitBasket, /FRUIT_TYPES = \['apple', 'banana', 'grape', 'orange', 'pear', 'strawberry', 'watermelon', 'pineapple', 'mango', 'kiwi'\]/); +}); From 4740c4a41f4740e3a321d63307ae28e196fa1d89 Mon Sep 17 00:00:00 2001 From: Kiver Teixeira Date: Sun, 27 Sep 2026 12:58:07 -0300 Subject: [PATCH 4/8] fix(test): update approved brand assertions --- tests/brand.test.mjs | 10 ++++++---- tests/runtime-quality.test.mjs | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/brand.test.mjs b/tests/brand.test.mjs index 4345deba..886ae5ed 100644 --- a/tests/brand.test.mjs +++ b/tests/brand.test.mjs @@ -8,11 +8,13 @@ test('official game runtimes consume the locked approved Aprincar identity', () const three = fs.readFileSync(new URL('../src/runtime/three-runtime.js', import.meta.url), 'utf8'); const build = fs.readFileSync(new URL('../scripts/build-games.mjs', import.meta.url), 'utf8'); - assert.match(brand, /data-brand-version="4"/); - assert.match(brand, /aprincar-portal/); - assert.match(brand, /#4F6EF7/i); - assert.match(brand, /#FFC83D/i); + assert.match(brand, /data-brand-version="approved-v1"/); + assert.match(brand, /aprincar-approved/); + assert.match(brand, /#2563EB/i); + assert.match(brand, /#FBBF24/i); assert.match(brand, /fillTriangle/); + assert.match(brand, /Poppins/); + assert.match(brand, /quadraticBezierTo/); assert.match(phaser, /APRINCAR_BRAND/); assert.match(three, /APRINCAR_BRAND/); assert.match(build, /brand\.js/); diff --git a/tests/runtime-quality.test.mjs b/tests/runtime-quality.test.mjs index 19eea889..0cd29958 100644 --- a/tests/runtime-quality.test.mjs +++ b/tests/runtime-quality.test.mjs @@ -48,10 +48,10 @@ test('Three.js distinguishes drag using total pointer distance and does not shuf test('game runtime uses the locked approved Aprincar identity', () => { - assert.match(brand, /data-brand-version="4"/); - assert.match(brand, /aprincar-portal/); - assert.match(brand, /#4F6EF7/i); - assert.match(brand, /#FFC83D/i); + assert.match(brand, /data-brand-version="approved-v1"/); + assert.match(brand, /aprincar-approved/); + assert.match(brand, /#2563EB/i); + assert.match(brand, /#FBBF24/i); assert.doesNotMatch(brand, /aprincar-star/); assert.doesNotMatch(brand, /brandVersion', 3/); }); From 00648fadf36c0c0e2d5b94cccab05d8700f56bd1 Mon Sep 17 00:00:00 2001 From: Kiver Teixeira Date: Tue, 29 Sep 2026 15:44:00 -0300 Subject: [PATCH 5/8] fix(runtime): keep approved brand compatible with Phaser browser gate --- src/runtime/brand.js | 5 ++++- tests/browser-harness.mjs | 24 ++++++++++++++++++------ tests/runtime-quality.test.mjs | 11 +++++++++++ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/runtime/brand.js b/src/runtime/brand.js index 870829a6..d0528ee6 100644 --- a/src/runtime/brand.js +++ b/src/runtime/brand.js @@ -21,11 +21,14 @@ const mark = scene.add.container(x, y); const glyph = scene.add.graphics(); + // Keep the approved rounded-A silhouette with Graphics primitives that are + // supported by every Phaser 3 build shipped in the single-file games. glyph.lineStyle(9, 0x2563eb, 1); glyph.beginPath(); glyph.moveTo(3, 37); glyph.lineTo(13, 10); - glyph.quadraticBezierTo(20, -1, 27, 10); + glyph.lineTo(20, 4); + glyph.lineTo(27, 10); glyph.lineTo(38, 37); glyph.strokePath(); diff --git a/tests/browser-harness.mjs b/tests/browser-harness.mjs index f383a351..c772a90e 100644 --- a/tests/browser-harness.mjs +++ b/tests/browser-harness.mjs @@ -212,6 +212,19 @@ async function waitForProcessExit(processRef, timeoutMs = 1500) { }); } +async function removeDirectoryWithRetry(directory, attempts = 12) { + for (let attempt = 1; attempt <= attempts; attempt += 1) { + try { + fs.rmSync(directory, { recursive: true, force: true }); + return; + } catch (error) { + const retryable = error?.code === 'ENOTEMPTY' || error?.code === 'EBUSY' || error?.code === 'EPERM'; + if (!retryable || attempt === attempts) throw error; + await sleep(Math.min(600, 75 * attempt)); + } + } +} + async function launchChrome() { const chrome = findChrome(); const debugPort = await freePort(); @@ -255,12 +268,11 @@ async function launchChrome() { processRef.kill('SIGKILL'); await waitForProcessExit(processRef, 1000); } - fs.rmSync(userDataDir, { - recursive: true, - force: true, - maxRetries: 8, - retryDelay: 75 - }); + // Chrome may leave profile writers alive for a few milliseconds after the + // parent process exits. Retry the whole recursive removal instead of + // trusting a single rimraf pass. + await sleep(150); + await removeDirectoryWithRetry(userDataDir); }, }; } diff --git a/tests/runtime-quality.test.mjs b/tests/runtime-quality.test.mjs index 0cd29958..7a39e357 100644 --- a/tests/runtime-quality.test.mjs +++ b/tests/runtime-quality.test.mjs @@ -105,3 +105,14 @@ test('approved game artwork exposes the complete fruit set without emoji fallbac assert.match(vectorArt, /Approved glossy fruit set/); assert.match(fruitBasket, /FRUIT_TYPES = \['apple', 'banana', 'grape', 'orange', 'pear', 'strawberry', 'watermelon', 'pineapple', 'mango', 'kiwi'\]/); }); + + +test('approved Phaser brand avoids unsupported Graphics curve APIs', () => { + assert.doesNotMatch(brand, /quadraticBezierTo/); + assert.match(brand, /glyph\.lineTo\(20, 4\)/); +}); + +test('browser cleanup retries whole profile removal after Chrome exits', () => { + assert.match(browserHarness, /removeDirectoryWithRetry/); + assert.match(browserHarness, /await sleep\(150\)/); +}); From 73f530922b668078954f1d2330ee6efd9ed0cf5b Mon Sep 17 00:00:00 2001 From: Kiver Teixeira Date: Tue, 29 Sep 2026 16:27:04 -0300 Subject: [PATCH 6/8] test(runtime): align visual gate with compatible Phaser brand --- tests/brand.test.mjs | 3 ++- tests/runtime-quality.test.mjs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/brand.test.mjs b/tests/brand.test.mjs index 886ae5ed..e96b92e3 100644 --- a/tests/brand.test.mjs +++ b/tests/brand.test.mjs @@ -14,7 +14,8 @@ test('official game runtimes consume the locked approved Aprincar identity', () assert.match(brand, /#FBBF24/i); assert.match(brand, /fillTriangle/); assert.match(brand, /Poppins/); - assert.match(brand, /quadraticBezierTo/); + assert.doesNotMatch(brand, /quadraticBezierTo/); + assert.match(brand, /glyph\.lineTo\(20, 4\)/); assert.match(phaser, /APRINCAR_BRAND/); assert.match(three, /APRINCAR_BRAND/); assert.match(build, /brand\.js/); diff --git a/tests/runtime-quality.test.mjs b/tests/runtime-quality.test.mjs index 7a39e357..72d25f3b 100644 --- a/tests/runtime-quality.test.mjs +++ b/tests/runtime-quality.test.mjs @@ -67,8 +67,8 @@ test('reversible counting publishes interactive targets at their current visual test('browser harness waits for Chrome exit and retries temporary directory cleanup', () => { assert.match(browserHarness, /waitForProcessExit/); - assert.match(browserHarness, /maxRetries:\s*8/); - assert.match(browserHarness, /retryDelay:\s*75/); + assert.match(browserHarness, /removeDirectoryWithRetry/); + assert.match(browserHarness, /await sleep\(150\)/); }); From 922c56a689e3b0dcab46fdcad961ac9508e329ae Mon Sep 17 00:00:00 2001 From: Kiver Teixeira Date: Wed, 25 Nov 2026 08:44:28 -0300 Subject: [PATCH 7/8] ci: migrate unmerged official games redesign without publishing --- .github/workflows/import-games-redesign.yml | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/import-games-redesign.yml diff --git a/.github/workflows/import-games-redesign.yml b/.github/workflows/import-games-redesign.yml new file mode 100644 index 00000000..bfee29f3 --- /dev/null +++ b/.github/workflows/import-games-redesign.yml @@ -0,0 +1,47 @@ +name: Import pending official games redesign +on: + push: + branches: [feat/migrate-official-games-redesign] + paths: [.github/workflows/import-games-redesign.yml] +permissions: + contents: write +jobs: + migrate: + if: github.repository == 'aprincar/platform' && github.ref == 'refs/heads/feat/migrate-official-games-redesign' + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + HUSKY: '0' + steps: + - uses: actions/checkout@v4 + with: + ref: feat/migrate-official-games-redesign + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Preserve pending PR patch and history in the monorepo + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + base=e46e7650f0dd16df143c5a30fbc27356ff4fe736 + head=73f530922b668078954f1d2330ee6efd9ed0cf5b + git fetch --no-tags https://github.com/aprincar/games-official.git refs/pull/27/head + test "$(git rev-parse FETCH_HEAD)" = "$head" + git merge-base --is-ancestor "$base" HEAD + git diff --binary "$base" "$head" | git apply --index --directory=games/official + tree="$(git write-tree)" + merged="$(git commit-tree "$tree" -p HEAD -p "$head" -m 'feat(games): preserve draft visual redesign from games-official#27')" + git merge --ff-only "$merged" + git merge-base --is-ancestor "$head" HEAD + npm ci --no-audit + npm run build:games + git rm .github/workflows/import-games-redesign.yml + git add games/official/games apps/app/public apps/hub/public + git commit -m "chore: regenerate game snapshots for migrated redesign" + git push origin HEAD:refs/heads/feat/migrate-official-games-redesign + - name: Verify game contracts + run: | + npm run check:snapshot + npm run verify:official + npm run check -w games/official From 2cbc19959cc25cde14803d219b29deffe4b5a92d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Nov 2026 11:44:48 +0000 Subject: [PATCH 8/8] chore: regenerate game snapshots for migrated redesign --- .github/workflows/import-games-redesign.yml | 47 --- .../public/extensions/block-tower/game.html | 255 +++++++++------- .../extensions/block-tower/integrity.json | 2 +- .../public/extensions/color-match/game.html | 255 +++++++++------- .../extensions/color-match/integrity.json | 2 +- .../extensions/counting-animals/game.html | 259 +++++++++------- .../counting-animals/integrity.json | 2 +- .../extensions/cursive-letters/game.html | 255 +++++++++------- .../extensions/cursive-letters/integrity.json | 2 +- .../public/extensions/fruit-basket/game.html | 287 ++++++++++-------- .../extensions/fruit-basket/integrity.json | 2 +- .../extensions/guided-painting/game.html | 255 +++++++++------- .../extensions/guided-painting/integrity.json | 2 +- .../public/extensions/letter-hunt/game.html | 255 +++++++++------- .../extensions/letter-hunt/integrity.json | 2 +- .../extensions/memory-animals/game.html | 255 +++++++++------- .../extensions/memory-animals/integrity.json | 2 +- .../public/extensions/paint-free/game.html | 255 +++++++++------- .../extensions/paint-free/integrity.json | 2 +- .../public/extensions/pattern-play/game.html | 255 +++++++++------- .../extensions/pattern-play/integrity.json | 2 +- .../extensions/prewriting-trails/game.html | 255 +++++++++------- .../prewriting-trails/integrity.json | 2 +- .../public/extensions/print-letters/game.html | 255 +++++++++------- .../extensions/print-letters/integrity.json | 2 +- .../extensions/space-shapes-3d/game.html | 75 +++-- .../extensions/space-shapes-3d/integrity.json | 2 +- apps/app/public/extensions/write-a/game.html | 255 +++++++++------- .../public/extensions/write-a/integrity.json | 2 +- apps/app/public/registry.json | 28 +- .../public/extensions/block-tower/game.html | 255 +++++++++------- .../extensions/block-tower/integrity.json | 2 +- .../public/extensions/color-match/game.html | 255 +++++++++------- .../extensions/color-match/integrity.json | 2 +- .../extensions/counting-animals/game.html | 259 +++++++++------- .../counting-animals/integrity.json | 2 +- .../extensions/cursive-letters/game.html | 255 +++++++++------- .../extensions/cursive-letters/integrity.json | 2 +- .../public/extensions/fruit-basket/game.html | 287 ++++++++++-------- .../extensions/fruit-basket/integrity.json | 2 +- .../extensions/guided-painting/game.html | 255 +++++++++------- .../extensions/guided-painting/integrity.json | 2 +- .../public/extensions/letter-hunt/game.html | 255 +++++++++------- .../extensions/letter-hunt/integrity.json | 2 +- .../extensions/memory-animals/game.html | 255 +++++++++------- .../extensions/memory-animals/integrity.json | 2 +- .../public/extensions/paint-free/game.html | 255 +++++++++------- .../extensions/paint-free/integrity.json | 2 +- .../public/extensions/pattern-play/game.html | 255 +++++++++------- .../extensions/pattern-play/integrity.json | 2 +- .../extensions/prewriting-trails/game.html | 255 +++++++++------- .../prewriting-trails/integrity.json | 2 +- .../public/extensions/print-letters/game.html | 255 +++++++++------- .../extensions/print-letters/integrity.json | 2 +- .../extensions/space-shapes-3d/game.html | 75 +++-- .../extensions/space-shapes-3d/integrity.json | 2 +- apps/hub/public/extensions/write-a/game.html | 255 +++++++++------- .../public/extensions/write-a/integrity.json | 2 +- apps/hub/public/registry.json | 28 +- games/official/games/block-tower/game.html | 255 +++++++++------- games/official/games/color-match/game.html | 255 +++++++++------- .../official/games/counting-animals/game.html | 259 +++++++++------- .../official/games/cursive-letters/game.html | 255 +++++++++------- games/official/games/fruit-basket/game.html | 287 ++++++++++-------- .../official/games/guided-painting/game.html | 255 +++++++++------- games/official/games/letter-hunt/game.html | 255 +++++++++------- games/official/games/memory-animals/game.html | 255 +++++++++------- games/official/games/paint-free/game.html | 255 +++++++++------- games/official/games/pattern-play/game.html | 255 +++++++++------- .../games/prewriting-trails/game.html | 255 +++++++++------- games/official/games/print-letters/game.html | 255 +++++++++------- .../official/games/space-shapes-3d/game.html | 75 +++-- games/official/games/write-a/game.html | 255 +++++++++------- 73 files changed, 5663 insertions(+), 4774 deletions(-) delete mode 100644 .github/workflows/import-games-redesign.yml diff --git a/.github/workflows/import-games-redesign.yml b/.github/workflows/import-games-redesign.yml deleted file mode 100644 index bfee29f3..00000000 --- a/.github/workflows/import-games-redesign.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Import pending official games redesign -on: - push: - branches: [feat/migrate-official-games-redesign] - paths: [.github/workflows/import-games-redesign.yml] -permissions: - contents: write -jobs: - migrate: - if: github.repository == 'aprincar/platform' && github.ref == 'refs/heads/feat/migrate-official-games-redesign' - runs-on: ubuntu-latest - timeout-minutes: 20 - env: - HUSKY: '0' - steps: - - uses: actions/checkout@v4 - with: - ref: feat/migrate-official-games-redesign - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: 22 - - name: Preserve pending PR patch and history in the monorepo - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - base=e46e7650f0dd16df143c5a30fbc27356ff4fe736 - head=73f530922b668078954f1d2330ee6efd9ed0cf5b - git fetch --no-tags https://github.com/aprincar/games-official.git refs/pull/27/head - test "$(git rev-parse FETCH_HEAD)" = "$head" - git merge-base --is-ancestor "$base" HEAD - git diff --binary "$base" "$head" | git apply --index --directory=games/official - tree="$(git write-tree)" - merged="$(git commit-tree "$tree" -p HEAD -p "$head" -m 'feat(games): preserve draft visual redesign from games-official#27')" - git merge --ff-only "$merged" - git merge-base --is-ancestor "$head" HEAD - npm ci --no-audit - npm run build:games - git rm .github/workflows/import-games-redesign.yml - git add games/official/games apps/app/public apps/hub/public - git commit -m "chore: regenerate game snapshots for migrated redesign" - git push origin HEAD:refs/heads/feat/migrate-official-games-redesign - - name: Verify game contracts - run: | - npm run check:snapshot - npm run verify:official - npm run check -w games/official diff --git a/apps/app/public/extensions/block-tower/game.html b/apps/app/public/extensions/block-tower/game.html index a6e701c1..d66dfa6d 100644 --- a/apps/app/public/extensions/block-tower/game.html +++ b/apps/app/public/extensions/block-tower/game.html @@ -1,5 +1,5 @@ Torre de Blocos — Aprincar