Repository navigation
pocket blocks 1.5: frame clock instead of a shell loop, for battery - #527
Open
thucngyyen wants to merge 2 commits into
Open
thucngyyen wants to merge 2 commits into
thucngyyen wants to merge 2 commits into
Conversation
… a shell loop The 8-a-second tick came from a bash stream that ran sleep 0.125 in a loop, which under proot keeps a process and the CPU busy the whole time the app is open, even paused. It now counts ticks in every frame with fps 8 while playing and 2 between games, so no Linux process runs and bash and coreutils are no longer required. Needs owl 21 for every frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thucngyyen
marked this pull request as ready for review
November 20, 2026 00:51
A piece resting on the floor or the stack only locked at the next gravity step, up to a second at level 1, so it could still be slid sideways after landing. It now locks on the next tick, an eighth of a second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pocket blocks keeps its 8-a-second gravity tick with a bash
streamthat runssleep 0.125in a loop. On the phone that means a process under proot forking eight times a second for as long as the app is open, paused or not, which drains the battery noticeably and makes input feel laggy.This version counts the same ticks in
every frameinstead:fps: mode == "play" ? 8 : 2, so 8 frames a second while playing and 2 between games, for the blinking PUSH STARTrequires { bash, coreutils }is goneowlgoes from 11 to 21 forevery frame, version 1.4 to 1.5java -jar tools/owl.jar reviewpasses. Played through on a phone: gravity, holds, pause and game over work as before.Measured on the phone, the old loop used about 0.4 s of CPU per 10 s in bash alone (proot's own overhead on top), and only reached 69 of 80 ticks in 10 s, so gravity ran about 15% slow and unevenly.
Note: this changes an app under another author's folder, so the review check's ownership rule fails; the file itself passes.
🤖 Generated with Claude Code