- tb_editor_qr_show_part (para testes) fixa a parte mostrada no painel
"Compartilhar blueprint" em vez do loop de 1 s; -1 volta ao loop.
- scratchblocks: campo redondo com texto que nao e numero sai entre
colchetes ("= [#]"), senao a volta lia como variavel; o texto importado
num campo redondo volta como texto. "exportar(importar(exportado))"
fica estavel.
- Harness cenario 36: o labirinto 3D (tests/data/labirinto.sb) entra pelo
MCP, roda (37 cristais), exporta e importa com o mesmo resultado e passa
pelo QR: cada parte desenhada e lida de volta, recebida fora de ordem e
com repetidas.
- Fixture tests/data/labirinto.sb (mapa em notacao do forum).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
203 lines
6.2 KiB
Plaintext
203 lines
6.2 KiB
Plaintext
when flag clicked
|
|
nova cena 3D
|
|
cor do céu [#0f1630]
|
|
luz vindo de x (-0.3) y (1) z (0.6)
|
|
luz ambiente (0.55)
|
|
set [M v] to (junte [#########] com (junte [#...#...#] com (junte [#.#.#.#.#] com (junte [#.......#] com (junte [##.#.#.##] com (junte [#.......#] com (junte [#.#.#.#.#] com (junte [#...#...#] com [#########]))))))))
|
|
crie plano [chao] em x (0) y (0) z (0)
|
|
mude o tamanho de [chao] para x (9) y (1) z (9)
|
|
mude a cor de [chao] para [#1c2445]
|
|
set [total v] to (0)
|
|
set [n v] to (1)
|
|
repeat (81)
|
|
set [r v] to ([floor v] of (((n) - (1)) / (9)))
|
|
set [c v] to (((n) - (1)) - ((r) * (9)))
|
|
if <(letra (n) de (M)) = [#]> then
|
|
crie cubo (junte [w] com (n)) em x ((c) - (4)) y (0.5) z ((r) - (4))
|
|
mude a cor de (junte [w] com (n)) para [#3b5bdb]
|
|
else
|
|
crie esfera (junte [c] com (n)) em x ((c) - (4)) y (0.45) z ((r) - (4))
|
|
mude o tamanho de (junte [c] com (n)) para x (0.3) y (0.3) z (0.3)
|
|
mude a cor de (junte [c] com (n)) para [#7ef0ff]
|
|
change [total v] by (1)
|
|
end
|
|
change [n v] by (1)
|
|
end
|
|
set [pr v] to (5)
|
|
set [pc v] to (4)
|
|
set [dr v] to (0)
|
|
set [dc v] to (0)
|
|
crie cubo [eu] em x (0) y (0.45) z (1)
|
|
mude o tamanho de [eu] para x (0.7) y (0.7) z (0.7)
|
|
mude a cor de [eu] para [#ffd23f]
|
|
set [e1r v] to (1)
|
|
set [e1c v] to (1)
|
|
crie esfera [drone1] em x (-3) y (0.45) z (-3)
|
|
mude o tamanho de [drone1] para x (0.75) y (0.75) z (0.75)
|
|
mude a cor de [drone1] para [#ff5d73]
|
|
set [e2r v] to (7)
|
|
set [e2c v] to (7)
|
|
crie esfera [drone2] em x (3) y (0.45) z (3)
|
|
mude o tamanho de [drone2] para x (0.75) y (0.75) z (0.75)
|
|
mude a cor de [drone2] para [#c77dff]
|
|
câmera em x (0) y (10) z (6.5) olhando para x (0) y (0) z (0.6)
|
|
set [pontos v] to (0)
|
|
set [vivo v] to (1)
|
|
set [t v] to (0)
|
|
forever
|
|
if <(vivo) = (1)> then
|
|
if <tecla [direita] pressionada?> then
|
|
set [dr v] to (0)
|
|
set [dc v] to (1)
|
|
end
|
|
if <tecla [esquerda] pressionada?> then
|
|
set [dr v] to (0)
|
|
set [dc v] to (-1)
|
|
end
|
|
if <tecla [cima] pressionada?> then
|
|
set [dr v] to (-1)
|
|
set [dc v] to (0)
|
|
end
|
|
if <tecla [baixo] pressionada?> then
|
|
set [dr v] to (1)
|
|
set [dc v] to (0)
|
|
end
|
|
if <tocando a tela?> then
|
|
if <(valor absoluto de (x do toque (1))) > (valor absoluto de (y do toque (1)))> then
|
|
set [dr v] to (0)
|
|
if <(x do toque (1)) > (0)> then
|
|
set [dc v] to (1)
|
|
else
|
|
set [dc v] to (-1)
|
|
end
|
|
else
|
|
set [dc v] to (0)
|
|
if <(y do toque (1)) > (0)> then
|
|
set [dr v] to (-1)
|
|
else
|
|
set [dr v] to (1)
|
|
end
|
|
end
|
|
end
|
|
change [t v] by (1)
|
|
if <(resto de (t) por (8)) = (0)> then
|
|
if <not <(letra (((((pr) + (dr)) * (9)) + ((pc) + (dc))) + (1)) de (M)) = [#]>> then
|
|
change [pr v] by (dr)
|
|
change [pc v] by (dc)
|
|
end
|
|
mova [eu] para x ((pc) - (4)) y (0.45) z ((pr) - (4))
|
|
set [cel v] to (junte [c] com ((((pr) * (9)) + (pc)) + (1)))
|
|
set [antes v] to (número de objetos 3D)
|
|
apague o objeto (cel)
|
|
if <(número de objetos 3D) < (antes)> then
|
|
change [pontos v] by (1)
|
|
end
|
|
end
|
|
if <<(t) > (180)> and <(resto de (t) por (18)) = (0)>> then
|
|
set [mr v] to (0)
|
|
set [mc v] to (0)
|
|
if <(pr) > (e1r)> then
|
|
set [mr v] to (1)
|
|
end
|
|
if <(pr) < (e1r)> then
|
|
set [mr v] to (-1)
|
|
end
|
|
if <(pc) > (e1c)> then
|
|
set [mc v] to (1)
|
|
end
|
|
if <(pc) < (e1c)> then
|
|
set [mc v] to (-1)
|
|
end
|
|
if <<not <(mr) = (0)>> and <not <(mc) = (0)>>> then
|
|
if <(número aleatório entre (1) e (2)) = (1)> then
|
|
set [mr v] to (0)
|
|
else
|
|
set [mc v] to (0)
|
|
end
|
|
end
|
|
if <(letra (((((e1r) + (mr)) * (9)) + ((e1c) + (mc))) + (1)) de (M)) = [#]> then
|
|
set [k v] to (número aleatório entre (1) e (4))
|
|
set [mr v] to (0)
|
|
set [mc v] to (0)
|
|
if <(k) = (1)> then
|
|
set [mr v] to (1)
|
|
end
|
|
if <(k) = (2)> then
|
|
set [mr v] to (-1)
|
|
end
|
|
if <(k) = (3)> then
|
|
set [mc v] to (1)
|
|
end
|
|
if <(k) = (4)> then
|
|
set [mc v] to (-1)
|
|
end
|
|
end
|
|
if <not <(letra (((((e1r) + (mr)) * (9)) + ((e1c) + (mc))) + (1)) de (M)) = [#]>> then
|
|
change [e1r v] by (mr)
|
|
change [e1c v] by (mc)
|
|
end
|
|
mova [drone1] para x ((e1c) - (4)) y (0.45) z ((e1r) - (4))
|
|
set [mr v] to (0)
|
|
set [mc v] to (0)
|
|
if <(pr) > (e2r)> then
|
|
set [mr v] to (1)
|
|
end
|
|
if <(pr) < (e2r)> then
|
|
set [mr v] to (-1)
|
|
end
|
|
if <(pc) > (e2c)> then
|
|
set [mc v] to (1)
|
|
end
|
|
if <(pc) < (e2c)> then
|
|
set [mc v] to (-1)
|
|
end
|
|
if <<not <(mr) = (0)>> and <not <(mc) = (0)>>> then
|
|
if <(número aleatório entre (1) e (2)) = (1)> then
|
|
set [mr v] to (0)
|
|
else
|
|
set [mc v] to (0)
|
|
end
|
|
end
|
|
if <(letra (((((e2r) + (mr)) * (9)) + ((e2c) + (mc))) + (1)) de (M)) = [#]> then
|
|
set [k v] to (número aleatório entre (1) e (4))
|
|
set [mr v] to (0)
|
|
set [mc v] to (0)
|
|
if <(k) = (1)> then
|
|
set [mr v] to (1)
|
|
end
|
|
if <(k) = (2)> then
|
|
set [mr v] to (-1)
|
|
end
|
|
if <(k) = (3)> then
|
|
set [mc v] to (1)
|
|
end
|
|
if <(k) = (4)> then
|
|
set [mc v] to (-1)
|
|
end
|
|
end
|
|
if <not <(letra (((((e2r) + (mr)) * (9)) + ((e2c) + (mc))) + (1)) de (M)) = [#]>> then
|
|
change [e2r v] by (mr)
|
|
change [e2c v] by (mc)
|
|
end
|
|
mova [drone2] para x ((e2c) - (4)) y (0.45) z ((e2r) - (4))
|
|
end
|
|
if <<<(e1r) = (pr)> and <(e1c) = (pc)>> or <<(e2r) = (pr)> and <(e2c) = (pc)>>> then
|
|
set [vivo v] to (0)
|
|
mude a cor de [eu] para [cinza]
|
|
end
|
|
if <(pontos) = (total)> then
|
|
set [vivo v] to (2)
|
|
end
|
|
end
|
|
apague tudo
|
|
desenhe (imagem da cena de (240) por (180)) em x (0) y (0) escala (2)
|
|
mude a cor da caneta para r (255) g (255) b (255)
|
|
escreva (junte [Cristais: ] com (junte (pontos) com (junte [ / ] com (total)))) no palco em x (-225) y (165)
|
|
if <(vivo) = (0)> then
|
|
escreva [Pego pelo drone! Clique na bandeira para jogar de novo] no palco em x (-200) y (0)
|
|
end
|
|
if <(vivo) = (2)> then
|
|
escreva [Voce pegou todos os cristais!] no palco em x (-120) y (0)
|
|
end
|
|
end
|