From 18e8675ceb38f7e84a077b0f719cac2995928d49 Mon Sep 17 00:00:00 2001 From: RodrigoDornelles Date: Wed, 4 Dec 2024 10:09:51 -0300 Subject: [PATCH] change: visual identity flappy bird clone --- samples/{flappybird => capybird}/game.lua | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) rename samples/{flappybird => capybird}/game.lua (90%) diff --git a/samples/flappybird/game.lua b/samples/capybird/game.lua similarity index 90% rename from samples/flappybird/game.lua rename to samples/capybird/game.lua index 806b027..cb766e0 100644 --- a/samples/flappybird/game.lua +++ b/samples/capybird/game.lua @@ -2,10 +2,10 @@ local function draw_logo(std, game, height, anim) anim = anim or 0 std.text.font_size(32) std.draw.color(std.color.white) - local s1 = std.text.mensure('FlappyTv') - std.text.print(game.width/2 - s1/2, height + anim, 'Flappy') - std.draw.color(std.color.red) - std.text.print(game.width/2 + s1/2 - std.text.mensure('Tv'), height - anim, 'Tv') + local s1 = std.text.mensure('CapyBird') + std.text.print(game.width/2 - s1/2, height + anim, 'Capy') + std.draw.color(std.color.yellow) + std.text.print(game.width/2 + s1/2 - std.text.mensure('Bird'), height - anim, 'Birdy') return s1 end @@ -138,7 +138,7 @@ local function loop(std, game) end local function draw(std, game) - std.draw.clear(std.color.black) + std.draw.clear(std.color.skyblue) if game.state == 1 then local h = game.height/16 @@ -164,24 +164,26 @@ local function draw(std, game) std.draw.color(std.color.green) for _, pipe in ipairs(game.pipes) do -- Top pipe - std.draw.rect(1, pipe.x, 0, game.pipe_width, pipe.y) + std.draw.rect(0, pipe.x, 0, game.pipe_width, pipe.y) -- Bottom pipe - std.draw.rect(1, pipe.x, pipe.y + game.pipe_gap, game.pipe_width, game.height - pipe.y - game.pipe_gap) + std.draw.rect(0, pipe.x, pipe.y + game.pipe_gap, game.pipe_width, game.height - pipe.y - game.pipe_gap) end -- Draw bird - std.draw.color(std.color.yellow) + std.draw.color(std.color.beige) + std.draw.rect(0, game.width/4, game.bird_y, 20, 20) + std.draw.color(std.color.darkbrown) std.draw.rect(1, game.width/4, game.bird_y, 20, 20) -- Score display - std.draw.color(std.color.white) + std.draw.color(std.color.yellow) std.text.font_size(16) std.text.print_ex(game.width - 100, 20, 'Score: ' .. game.score, 0) end -- Game over screen if game.state == 3 then - std.draw.color(std.color.red) + std.draw.color(std.color.black) std.text.font_size(32) std.text.print_ex(game.width/2, game.height/2, 'Game Over', 0) end @@ -194,15 +196,13 @@ end local P = { meta={ - title='FlappyTV', + title='CapyBird', author='Alex Oliveira', description='A simple Flappy Bird clone', version='1.0.0' }, config = { require = 'math math.random', - fps_drop = 5, - fps_time = 5 }, callbacks={ init=init, @@ -212,4 +212,4 @@ local P = { } } -return P \ No newline at end of file +return P