Update all remaining games to use text_scaled with scale=2
Updated games: - pong.lua: All text now uses text_scaled with scale=2 - air_hockey.lua: All text now uses text_scaled with scale=2 - asteroids.lua: All text now uses text_scaled with scale=2 - ball.lua: All text now uses text_scaled with scale=2 - breakout.lua: All text now uses text_scaled with scale=2 - counter.lua: All text now uses text_scaled with scale=2 - flappy_bird.lua: All text now uses text_scaled with scale=2 - lunar_lander.lua: All text now uses text_scaled with scale=2 - snake.lua: All text now uses text_scaled with scale=2 - tetris.lua: All text now uses text_scaled with scale=2 All 14 games now have consistent 2x text scaling for better readability.
This commit is contained in:
@@ -94,9 +94,9 @@ function draw()
|
||||
|
||||
-- Draw: MENU
|
||||
if state == STATE_MENU then
|
||||
renderer.text(game.width() / 2 - 15, game.height() / 2 - 30, "PONG", true)
|
||||
renderer.text(game.width() / 2 - 50, game.height() / 2, "Tap to Start", true)
|
||||
renderer.text(game.width() / 2 - 70, game.height() / 2 + 20, "First to " .. tostring(MAX_SCORE), true)
|
||||
renderer.text_scaled(game.width() / 2 - 15, game.height() / 2 - 30, "PONG", true, 2)
|
||||
renderer.text_scaled(game.width() / 2 - 50, game.height() / 2, "Tap to Start", true, 2)
|
||||
renderer.text_scaled(game.width() / 2 - 70, game.height() / 2 + 20, "First to " .. tostring(MAX_SCORE), true, 2)
|
||||
|
||||
-- Draw: PLAYING
|
||||
elseif state == STATE_PLAYING then
|
||||
@@ -115,23 +115,23 @@ function draw()
|
||||
-- Draw scores
|
||||
local left_score_text = tostring(game.vars.paddle_left_score)
|
||||
local right_score_text = tostring(game.vars.paddle_right_score)
|
||||
renderer.text(game.width() / 2 - 30, 5, left_score_text, true)
|
||||
renderer.text(game.width() / 2 + 20, 5, right_score_text, true)
|
||||
renderer.text_scaled(game.width() / 2 - 30, 5, left_score_text, true, 2)
|
||||
renderer.text_scaled(game.width() / 2 + 20, 5, right_score_text, true, 2)
|
||||
|
||||
-- Draw: GAME_OVER
|
||||
elseif state == STATE_GAME_OVER then
|
||||
renderer.text(game.width() / 2 - 40, game.height() / 2 - 30, "GAME OVER", true)
|
||||
renderer.text_scaled(game.width() / 2 - 40, game.height() / 2 - 30, "GAME OVER", true, 2)
|
||||
|
||||
local winner = "Player 1 Wins!"
|
||||
if game.vars.paddle_right_score > game.vars.paddle_left_score then
|
||||
winner = "Player 2 Wins!"
|
||||
end
|
||||
renderer.text(game.width() / 2 - 50, game.height() / 2, winner, true)
|
||||
renderer.text_scaled(game.width() / 2 - 50, game.height() / 2, winner, true, 2)
|
||||
|
||||
local final_text = game.vars.paddle_left_score .. " - " .. game.vars.paddle_right_score
|
||||
renderer.text(game.width() / 2 - 25, game.height() / 2 + 20, final_text, true)
|
||||
renderer.text_scaled(game.width() / 2 - 25, game.height() / 2 + 20, final_text, true, 2)
|
||||
|
||||
renderer.text(game.width() / 2 - 60, game.height() / 2 + 40, "Tap to Menu", true)
|
||||
renderer.text_scaled(game.width() / 2 - 60, game.height() / 2 + 40, "Tap to Menu", true, 2)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user