Skip to content

Checkpoint: Add tile change persistence - #2877

Open
NataliaOspinal wants to merge 7 commits into
endlessm:mainfrom
NataliaOspinal:main
Open

NataliaOspinal wants to merge 7 commits into
endlessm:mainfrom
NataliaOspinal:main

Conversation

@NataliaOspinal

@NataliaOspinal NataliaOspinal commented Sep 10, 2026

Copy link
Copy Markdown

Whenever an enemy changes part of the tilemap as the VoidSpreadingEnemy does, if the player reaches a checkpoint and dies, the scene resets to its original state instead of keeping the changes that we'd like to keep in previous traveled zones for storytelling or possible gameplay mechanics.

To fix this, I created a new Checkpoint child class (I wasn't sure I could edit the original, but if that's the idea I could just add a checkbox for persistent enemies and the respective exports to incorporate the code to the original) that effectively tracks with both _process and _physics_process for accuracy of tile changes, checking the respective paths and its enemy states.

Note: I've included (as part of the code) a way to track the changes of a possible void-spreading guard, since that was the idea shown in the screenshots of the issue!

Resolves: #1208

@NataliaOspinal
NataliaOspinal requested a review from a team as a code owner September 10, 2026 23:11
@github-actions

Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/NataliaOspinal/main/.

(This launches the game from the start, not directly at the change(s) in this pull request.)


# Store everything including position, paths, and consumed tiles in a single dictionary
# bound strictly to each enemy to prevent synchronization issues.
static var saved_enemy_states: Dictionary = {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented on #1208 (comment) I don't think static variables are an appropriate approach.

Gotta fuse the new code with the og checkpoint in a way that doesn't affect (?) existing ones
@manuq

manuq commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

@NataliaOspinal I see you have added new changes. Let us know when it's ready for review again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support checkpoints in expanding void levels

3 participants