Godot 4.6 + GDExtension + blox_core.dll. La demo carga player.blox, ejecuta FUNCION PRINCIPAL, llama update(dt, entrada) por frame y aplica la TABLA devuelta por BLOX.

















Ejemplos reales tomados de main.gd y player.blox.
update()var blox := BloxRuntime.new()
if not blox.is_ready():
push_error(blox.get_last_error())
return
var script_path := ProjectSettings.globalize_path("res://scripts/player.blox")
blox.load_file(script_path)
blox.run_main()
blox.call_function("init")
# En el _process(delta):
blox.set_host_state(make_host_state())
var state = blox.call_function(
"update",
[delta, make_input_state(mode, dir.x, dir.y, attack)]
)
apply_entity_states(state)update() entre nivelesFUNCION update(dt, entrada)
INICIO
TABLA estado_juego_iniciado, estado_nivel_actual
NUMERICO nivel_actual
LOGICO juego_iniciado
estado_juego_iniciado = GODOT_ESTADO("juego_iniciado")
estado_nivel_actual = GODOT_ESTADO("nivel_actual")
nivel_actual = 1
juego_iniciado = estado_juego_iniciado[1].logico
SI (juego_iniciado == VERDADERO) ENTONCES
nivel_actual = estado_nivel_actual[1].numero
FIN_SI
SI (nivel_actual == 1) ENTONCES
RETORNAR update_nivel_1(dt, entrada)
FIN_SI
SI (nivel_actual == 2) ENTONCES
RETORNAR update_nivel_2(dt, entrada)
FIN_SI
RETORNAR update_nivel_1(dt, entrada)
FINAL_FUNCIONAGREGAR(estados, {id = "__sonido", sonido = "player_hit"})
SI (jugador[1].vida < 1) ENTONCES
game_over = VERDADERO
AGREGAR(estados, {id = "__sonido", sonido = "game_over"})
AGREGAR(estados, {id = "__mensaje", texto = "Sin vidas.", visible = VERDADERO})
FIN_SIBLOX no reproduce audio ni dibuja: pide al host que lo haga. El host aplica el cambio en su propio motor.
BloxVMBloxRuntimeblox_vm_create()blox_vm_load_file()blox_vm_run_main()blox_vm_call()blox_vm_register_native()load_file()run_main()call_function()set_host_state()get_last_error()GODOT_CREAR_ENTIDAD()GODOT_ESTADO()TABLABloxValueplayer.bloxy se puede editar sin recompilar la extensión C.