Add named Marks and cross-room NPC pathfinding
- Mark: a debug non-collidable named destination (pixel-art target icon), editor tool + name modal, globally-unique names, programmatic Room:addMark - NPCs walk to Marks: each RGB copy is a per-room resident (like the player), running its own A* on its own colour layer, transferring rooms as it crosses seams; rendered and collided by the room it currently stands in - Player copies are obstacles in NPC pathfinding - A* is footprint-aware for multi-cell NPCs - Editor: click an NPC to open a filterable destination picker - Ink: Dialogue.open binds walk_to; Jorge can be sent to "end"/"begin" - Fix: a blocked NPC now replans each tick and resumes instead of freezing - [npc] move diagnostics under DEBUG (start/goal/route or block reason) - Docs (adding-npcs) + CLAUDE.md LÖVE 11.x/float-colour corrections - Fix test harness loadSprite stub; movement tests green (28) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
ad405ed590
commit
c348b81a93
17 changed files with 2755 additions and 43 deletions
21
main.lua
21
main.lua
|
|
@ -100,6 +100,7 @@ function love.update(dt)
|
|||
if repeatedMove and not Dialogue.isOpen() and not MapManager:isOpen() then gameWorld:movePlayer(currentRoom, repeatedMove) end
|
||||
end
|
||||
currentRoom:update(dt)
|
||||
if gameWorld then gameWorld:update(dt) end
|
||||
MapManager:record(currentRoom)
|
||||
|
||||
-- if love.keyboard.isDown("w") then worldSha = worldSha + 1 end
|
||||
|
|
@ -174,6 +175,8 @@ function love.draw()
|
|||
love.graphics.setColor(1, 1, 1, 1)
|
||||
if DEBUG then love.graphics.draw(sideBarCanvas, sideBarBox.x, sideBarBox.y) end
|
||||
if DEBUG then editorDrawNoteHover() end
|
||||
if DEBUG then editorDrawMarkPicker() end
|
||||
if DEBUG then editorDrawMarkNameEditor() end
|
||||
love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10)
|
||||
PerfProfiler:draw()
|
||||
Dialogue.draw()
|
||||
|
|
@ -229,6 +232,24 @@ function love.keypressed(key)
|
|||
return
|
||||
end
|
||||
|
||||
-- The mark modals (destination picker, name entry) own the keyboard while open:
|
||||
-- characters filter/type via love.textinput, Enter confirms, Esc cancels.
|
||||
if DEBUG and (markPickerActive() or markNameEditorActive()) then
|
||||
if key == "escape" then
|
||||
editorCancelResponse()
|
||||
elseif key == "return" then
|
||||
response = ""
|
||||
editorCompleteResponse()
|
||||
elseif key == "backspace" then
|
||||
local byteoffset = utf8.offset(response, -1)
|
||||
if byteoffset then
|
||||
response = string.sub(response, 1, byteoffset - 1)
|
||||
editorTextHandler(response)
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
-- Tab toggles the editor's note overlay (DEBUG-only; default on).
|
||||
if DEBUG and key == "tab" then
|
||||
NOTES_VISIBLE = not NOTES_VISIBLE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue