Stop the section separators from reading as doc comments
The docs step aborted on "definition cannot be parsed" and "'Config' had no return?". Both come from the same thing: an 80-character rule of dashes starts with ---, which ldoc takes for a documentation comment and then tries to parse whatever follows as a definition. There are no real doc comments in this project — all 48 --- lines were decorative rules — so the fix is to spell them "-- " plus dashes. Same width on screen, invisible to ldoc. Verified by running the docs step's own alpine + luarocks + ldoc setup over the merged source: ldoc completes and writes docs/. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+48
-48
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Constants
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
-- Tile constants
|
||||
local TILE_SIZE = 8
|
||||
@@ -51,9 +51,9 @@ local GAME_STATE_HELP = 3
|
||||
local GAME_STATE_CREDITS = 4
|
||||
local GAME_STATE_SETTINGS = 5
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Game Configuration (easy to tweak game parameters)
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local Config = {
|
||||
-- Player settings
|
||||
@@ -91,9 +91,9 @@ local Config = {
|
||||
},
|
||||
}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Sound System (centralized audio management)
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local Sound = {
|
||||
effects = {
|
||||
@@ -120,9 +120,9 @@ function Sound.play(effect_name)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Modules
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local Input = {}
|
||||
local Map = {}
|
||||
@@ -141,9 +141,9 @@ local AI = {}
|
||||
local Player = {}
|
||||
local Game = {}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Game State
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local State = {
|
||||
game_state = GAME_STATE_SPLASH,
|
||||
@@ -170,9 +170,9 @@ for row = 1, MAP_HEIGHT do
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Powerup System (extensible)
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local POWERUP_TYPES = {
|
||||
{
|
||||
@@ -195,9 +195,9 @@ local POWERUP_TYPES = {
|
||||
},
|
||||
}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Powerup module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Powerup.get_config(type_name)
|
||||
for _, p in ipairs(POWERUP_TYPES) do
|
||||
@@ -267,9 +267,9 @@ function Powerup.check_pickup()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Input module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Input.action_pressed()
|
||||
return btnp(4) or keyp(48) -- A button or Space
|
||||
@@ -332,9 +332,9 @@ function Input.p2_action()
|
||||
return keyp(7) or btnp(12) -- G key or gamepad 2 A
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Map module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Map.can_move_to(gridX, gridY, player)
|
||||
if gridX < 1 or gridY < 1 or gridX > MAP_WIDTH or gridY > MAP_HEIGHT then
|
||||
@@ -380,9 +380,9 @@ function Map.is_spawn_area(row, col)
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Map Generators (extensible map generation system)
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local MapGenerators = {}
|
||||
|
||||
@@ -500,9 +500,9 @@ function Map.draw_tiles()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- TopBar module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function TopBar.draw()
|
||||
-- Background
|
||||
@@ -530,9 +530,9 @@ function TopBar.draw()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- UI module (shared utilities)
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function UI.print_shadow(text, x, y, color, fixed, scale)
|
||||
scale = scale or 1
|
||||
@@ -540,9 +540,9 @@ function UI.print_shadow(text, x, y, color, fixed, scale)
|
||||
print(text, x, y, color, fixed, scale)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Splash module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Splash.update()
|
||||
-- Initialize on first frame
|
||||
@@ -563,9 +563,9 @@ function Splash.update()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Menu module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local MENU_ITEMS = {
|
||||
{
|
||||
@@ -638,9 +638,9 @@ function Menu.update()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Help module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Help.update()
|
||||
cls(COLOR_BLACK)
|
||||
@@ -687,9 +687,9 @@ function Help.update()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Credits module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Credits.update()
|
||||
cls(COLOR_BLACK)
|
||||
@@ -708,9 +708,9 @@ function Credits.update()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Settings module (persistent settings menu)
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
-- luacheck: globals pmem
|
||||
|
||||
@@ -926,9 +926,9 @@ function Settings.update()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- WinScreen module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function WinScreen.draw()
|
||||
cls(COLOR_BLACK)
|
||||
@@ -940,9 +940,9 @@ function WinScreen.draw()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- GameBoard module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function GameBoard.draw()
|
||||
Map.draw_shadows()
|
||||
@@ -959,9 +959,9 @@ function GameBoard.draw()
|
||||
TopBar.draw()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Bomb module (includes explosions)
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Bomb.draw(x, y)
|
||||
spr(BOMB_SPRITE, x, y, 0, 1)
|
||||
@@ -1102,9 +1102,9 @@ function Bomb.clear_all()
|
||||
State.explosions = {}
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- AI module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local function is_blast_line_blocked(pos1, pos2, fixedCoord, is_horizontal)
|
||||
local minPos = math.min(pos1, pos2)
|
||||
@@ -1375,9 +1375,9 @@ function AI.update(player, target)
|
||||
AI.move_and_bomb(player, target)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Player module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Player.draw(x, y, is_player1)
|
||||
local sprite_id = is_player1 and PLAYER_BLUE or PLAYER_RED
|
||||
@@ -1485,9 +1485,9 @@ function Player.reset(player)
|
||||
player.bombCooldown = 0
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Game module
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
function Game.init()
|
||||
State.winner = nil
|
||||
@@ -1561,9 +1561,9 @@ function Game.update()
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Main game loop
|
||||
--------------------------------------------------------------------------------
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local function update_playing()
|
||||
cls(COLOR_GREEN)
|
||||
|
||||
Reference in New Issue
Block a user