From b437094853c15504dbde74e37c0bfcb20755eef4 Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Wed, 23 Apr 2025 10:36:37 +0200 Subject: [PATCH] EXAMPLES: lua: avoid screen refresh effect in "trisdemo" In current version of the game, there is a "screen refresh" effect: the screen is cleared before being re-drawn. I moved the clear right after the connection is opened and removed it from rendering time. --- examples/lua/trisdemo.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/lua/trisdemo.lua b/examples/lua/trisdemo.lua index 7156df98d..4b60bb5ac 100644 --- a/examples/lua/trisdemo.lua +++ b/examples/lua/trisdemo.lua @@ -112,7 +112,7 @@ local function rotate_piece(piece, piece_id, px, py, board) end function render(applet, board, piece, piece_id, px, py, score) - local output = clear_screen .. cursor_home + local output = cursor_home output = output .. game_name .. " - Lines: " .. score .. "\r\n" output = output .. "+" .. string.rep("-", board_width * 2) .. "+\r\n" for y = 1, board_height do @@ -160,6 +160,7 @@ function handler(applet) end applet:send(cursor_hide) + applet:send(clear_screen) -- fall the piece by one line every delay local function fall_piece()