Repository navigation
Fix enemy rotation/HP-bar + smartphone playfield/UI (v1.1.3) - #3
Merged
Merged
Conversation
Enemy fix (single root cause): - Sprites are drawn facing right; the old code rotated the whole enemy node by dir.angle() + PI/2, which turned units 90 deg clockwise when travelling right and placed the health bar (drawn in local space at the top) on the right side, vertical. Rotate only the sprite child to dir.angle() and keep the enemy node unrotated, so the HP bar stays horizontal on top. Centre the sprite on the unit (offset = -texture.size * 0.5) so rotation spins around its own centre. Smartphone playfield/UI adaptation: - Add UIKit.is_compact() predicate (mobile feature, or window smaller than 900x560) and touch_min() sizing helper. - game_screen: full-screen board background in compact mode and a uniformly fitted playfield centred on the viewport. - HUD: enlarged compact chip/button strip on the playfield, ability row in the top bar, larger cancel/call buttons, bigger status fonts. - Larger compact sizes/fonts across build_button, ability_button, tower_panel, overlay, settings_screen/panel, main_menu, level_select, credits_screen so the UI reads well on phones while staying unchanged on PC. Validated: rotation diagnostic (all 4 enemy kinds) + tools/test.sh (unit, smoke, autoplay x3 difficulties) pass. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
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.
What
Fixes two player-visible problems and ships them in a new release.
1. Enemy rotation + health bar (single root cause)
Sprites are drawn facing right, but the old code rotated the whole enemy
node by dir.angle() + PI/2. Travelling right turned units 90 degrees clockwise,
and the health bar (drawn in local space at the top of the unit) landed on the
right side, vertical instead of on top.
Now only the sprite child is rotated to exactly dir.angle(), the enemy node
itself stays unrotated (so the HP bar stays horizontal on top), and the sprite
is centred on the unit so rotation spins around its own centre. Ground units
turn at every bend just like fliers.
2. Smartphone playfield / UI
than 900x560) plus a touch_min() sizing helper.
fitted playfield centred on the viewport.
top bar, larger cancel/call buttons, bigger status fonts.
overlay, settings_screen/panel, main_menu, level_select and credits_screen,
so the UI reads well on phones while staying unchanged on PC.
Version
Validation
bend, sprite rotation == dir.angle() and changes at a bend. PASSED.
all checks passed, no regressions.