Fish Engine

Blocos

Blocks

Cada objeto pode ter uma pilha de blocos. Eventos abrem um bloco de ações e são fechados com "Fim do evento"; você pode aninhar blocos arrastando pelo pino à esquerda. O botão Converter em Lua transforma a pilha em código equivalente.

Each object can have a stack of blocks. Events open a block of actions and are closed with "End event"; you can nest blocks by dragging the grip on the left. The Convert to Lua button turns the stack into equivalent code.

Eventos

Events

BlocoBlockQuando rodaWhen it runs
Quando iniciarOn startUma vez, ao executar.Once, when the game starts.
Enquanto tecla {s}While key {s}A cada quadro, se a tecla estiver pressionada. Teclas: esquerda, direita, cima, baixo.Every frame, while the key is held. Keys: esquerda, direita, cima, baixo.
Quando colidirem com {s}On collide with {s}Quando passa a tocar o objeto com aquele nome (dispara uma vez).When it starts touching the object with that name (fires once).
Quando o tilemap colidirOn tilemap collideQuando passa a tocar o chão/tilemap.When it starts touching the ground/tilemap.

Timer

Timer

BlocoBlockPara que serveWhat it does
A cada {} segundosEvery {} secondsRepete as ações no intervalo em segundos.Repeats the actions on the given interval in seconds.

Condições

Conditions

BlocoBlockPara que serveWhat it does
Se a condição {}If condition {}Roda as ações se a expressão for verdadeira. Use variáveis pelo nome, ex.: pontos > 10.Runs the actions if the expression is true. Use variable names directly, e.g. pontos > 10.
Se não for verdadeiraElseRoda as ações quando a condição acima for falsa.Runs the actions when the condition above is false.
Nas expressões, Math.floor, Math.random, etc. são traduzidos para Lua automaticamente na conversão.
In expressions, Math.floor, Math.random, etc. are translated to Lua automatically on conversion.

Sprite

Sprite

BlocoBlockLua
Definir Posição X {} Y {}Set positiondefinir_posicao(x, y)
Mover X {} Y {}Movemover(dx, dy)
Definir imagem {s}Set imagedefinir_imagem("a.png")
Definir largura {} / altura {}Set width / heightdefinir_largura(w) / definir_altura(h)
Definir cor {s}Set colordefinir_cor("#fff")
Remover objetoRemove objectremover()

Física

Physics

BlocoBlockLua
Pular força {}Jump force {}pular(f)
Definir velocidade Y {}Set Y velocity {}velocidade_y(v)

Objetos sem Static sofrem gravidade. Objetos com Sólido e as células de tilemap viram chão sólido. Use "Remover objeto" para fazer uma moeda sumir ao colidir com o jogador.

Objects without Static fall under gravity. Objects with Solid and tilemap cells become solid ground. Use "Remove object" to make a coin vanish when it hits the player.

Variáveis

Variables

BlocoBlockLua
Definir variável {s} como {}Set variabledefinir_var("pontos", 0)
Somar à variável {s} valor {}Add to variabledefinir_var("pontos", var("pontos") + 1)

Textos

Text

BlocoBlockLua
Mostrar texto {s}Show textmostrar_texto("Pontos: {pontos}")

Use {nome} para inserir o valor de uma variável no texto.

Use {name} to insert a variable value into the text.

Animações

Animations

BlocoBlockLua
Tocar animação {s}Play animationtocar("nome")
Parar animaçãoStop animationparar()
Espelhar imagem {}Flip imageespelhar(true)

Áudio

Audio

BlocoBlockLua
Tocar som {s}Play soundtocar_som("moeda.wav")
Tocar música {s}Play musictocar_musica("tema.ogg")
Parar sonsStop soundsparar_som() / parar_musica()

Câmera

Camera

BlocoBlockLua
Seguir objeto {s}Follow object {s}seguir("heroi")
Definir câmera X {} Y {}Set camera X {} Y {}camera(x, y)

Jogo

Game

BlocoBlockLua
Salvar jogoSave gamesalvar_jogo()
Carregar jogoLoad gamecarregar_jogo()