gameplay: dosable power and a playable landscape layout
Two findings from actually playing: 1. Shot power was hard to set and impossible to read. It was derived from the absolute distance to the tank (250 world px = 100 %) and only shown through the size of the aim dots, so direction and power changed together. Aiming is now a slingshot: the drag length sets the power (260 px = 100 %), the drag direction sets the shot direction, with a 6 px dead zone. Feedback: a dashed rubber band to the finger, a charge bar under the active tank with quarter marks, and a HUD row with angle plus a power bar and percentage. 2. Landscape was unplayable. The camera used zoom = max(fitHeight, fitWidth), so a wide view zoomed in and cropped the world top and bottom - and the camera never panned vertically, which put both tanks off-screen. The camera now always fits the world height, centres the world when the view is wider, and the background continues into the letterbox (ridges tiled, ground edge extended, vignette follows the visible range). Controls and paddings are compact in landscape. - new golden test landscape.png (840x420) shows both tanks and guards the bug; 18 tests green. - verified on the device in both orientations: shots fire, measured power 47 % and 54 % mid-gesture, no RenderFlex overflow in logcat, perf.sh still 60.0 fps / 0.0 % jank (p90 16.9 ms). - store screenshots re-captured with the new HUD and re-framed to 16:9; play-console.md release notes and "how to play" updated for 0.9.1. - release 0.9.1 (14).
@@ -13,6 +13,14 @@ Alle nennenswerten Änderungen an diesem Projekt. Format nach
|
||||
- (app) Zahnrad-Button mit Semantik-Label „Einstellungen“ und größerer Touch-Fläche (Barrierefreiheit)
|
||||
|
||||
### Fixed
|
||||
- (game) Querformat war unspielbar: die Kamera zoomte auf die Ansichtsbreite und schnitt die Welt
|
||||
oben/unten ab, ohne vertikales Pannen - beide Panzer lagen außerhalb des Bildes. Jetzt passt die
|
||||
Kamera immer die Welthöhe ein, zentriert bei breiter Ansicht und der Hintergrund (Himmel, Bergketten,
|
||||
Boden) läuft in die Ränder weiter. Neuer Golden-Test `landscape.png` hält das fest.
|
||||
- (game) Schusskraft war kaum zu dosieren und nicht ablesbar: Zielen läuft jetzt als Zurückziehen
|
||||
(Zuglänge = Kraft, 260 px = 100 %), mit Gummiband zum Finger, Kraftbalken unter dem Panzer und
|
||||
Prozentanzeige samt Winkel im HUD
|
||||
- (ui) Bedienelemente und Abstände im Querformat kompakter (kein Overflow, per logcat geprüft)
|
||||
- (game) Renderer wieder bei 60 fps / 0 % Jank: Vollbild-Gradient (Vignette), Gradient je
|
||||
Bergrücken, zwei geclippte Gradient-Rects und MaskFilter-Blur entfernt, Boden als
|
||||
`ui.Picture` pro Terrain-Version gecacht
|
||||
|
||||
@@ -429,18 +429,21 @@ class _MatchScreenState extends State<MatchScreen> {
|
||||
|
||||
/// HUD, canvas and controls of a running match.
|
||||
Widget _buildMatch(IronArcGame game) {
|
||||
final window = MediaQuery.sizeOf(context);
|
||||
// Landscape: the play area is the scarce resource, so chrome gets thinner.
|
||||
final compact = window.width > window.height;
|
||||
return SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 8, 12, 0),
|
||||
padding: EdgeInsets.fromLTRB(12, compact ? 4 : 8, 12, 0),
|
||||
child: Column(
|
||||
children: [
|
||||
ValueListenableBuilder<HudState>(
|
||||
valueListenable: game.hud,
|
||||
builder: (context, hud, _) => Hud(hud: hud),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
SizedBox(height: compact ? 3 : 6),
|
||||
AnimatedBuilder(
|
||||
animation: _session,
|
||||
builder: (context, _) =>
|
||||
@@ -478,7 +481,7 @@ class _MatchScreenState extends State<MatchScreen> {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
padding: EdgeInsets.fromLTRB(12, compact ? 4 : 8, 12, compact ? 4 : 8),
|
||||
child: AnimatedBuilder(
|
||||
animation: _session,
|
||||
builder: (context, _) => Controls(
|
||||
@@ -487,6 +490,7 @@ class _MatchScreenState extends State<MatchScreen> {
|
||||
onReplay: _playReplay,
|
||||
onFlush: _flushQueue,
|
||||
onAd: _showRewardedAd,
|
||||
compact: compact,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -98,8 +98,10 @@ class SkyArt {
|
||||
|
||||
void _build() {
|
||||
final rnd = math.Random(seed);
|
||||
for (var i = 0; i < 16; i++) {
|
||||
_stars.add(Offset(rnd.nextDouble() * kArtWorldWidth, rnd.nextDouble() * 430));
|
||||
for (var i = 0; i < 22; i++) {
|
||||
// Wider than the world: landscape letterboxes the sides with sky.
|
||||
_stars.add(Offset(
|
||||
-700 + rnd.nextDouble() * (kArtWorldWidth + 1400), rnd.nextDouble() * 430));
|
||||
}
|
||||
_ridges.addAll([
|
||||
_Ridge(
|
||||
@@ -153,28 +155,36 @@ class SkyArt {
|
||||
void paint(Canvas canvas, {required double camX, required double viewWidth}) {
|
||||
if (!_built) _build();
|
||||
|
||||
final left = camX - 12;
|
||||
final right = camX + viewWidth + 12;
|
||||
canvas.drawRect(
|
||||
const Rect.fromLTWH(0, 0, kArtWorldWidth, kArtWorldHeight),
|
||||
Rect.fromLTRB(left, 0, right, kArtWorldHeight),
|
||||
_skyPaint,
|
||||
);
|
||||
|
||||
_starPaint.color = const Color(0xFFDCE6F5).withValues(alpha: 0.22);
|
||||
for (final s in _stars) {
|
||||
final dx = s.dx + camX * 0.85;
|
||||
if (dx < -40 || dx > kArtWorldWidth + 40) continue;
|
||||
if (dx < left - 40 || dx > right + 40) continue;
|
||||
canvas.drawCircle(Offset(dx, s.dy), 2.2, _starPaint);
|
||||
}
|
||||
|
||||
_paintSun(canvas, Offset(camX + viewWidth * 0.66, 395));
|
||||
|
||||
// Tile the ridges so the horizon continues into the letterbox area.
|
||||
for (final ridge in _ridges) {
|
||||
canvas.save();
|
||||
canvas.translate(camX * (1 - ridge.parallax), 0);
|
||||
canvas.drawPath(ridge.path, ridge.fillPaint);
|
||||
if (ridge.rim.a > 0.01) {
|
||||
canvas.drawPath(ridge.path, ridge.rimPaint);
|
||||
final base = camX * (1 - ridge.parallax);
|
||||
for (final tile in const [-kArtWorldWidth, 0.0, kArtWorldWidth]) {
|
||||
final shift = base + tile;
|
||||
if (shift > right || shift + kArtWorldWidth < left) continue;
|
||||
canvas.save();
|
||||
canvas.translate(shift, 0);
|
||||
canvas.drawPath(ridge.path, ridge.fillPaint);
|
||||
if (ridge.rim.a > 0.01) {
|
||||
canvas.drawPath(ridge.path, ridge.rimPaint);
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,23 +608,92 @@ void paintAim(
|
||||
|
||||
/// Edge darkening without a full-screen radial gradient: four cheap bands.
|
||||
/// A single radial fill over 2048x1152 tripled the jank rate on the test device.
|
||||
void paintVignette(Canvas canvas) {
|
||||
const w = kArtWorldWidth;
|
||||
void paintVignette(Canvas canvas, {required double left, required double right}) {
|
||||
final w = right - left;
|
||||
const h = kArtWorldHeight;
|
||||
const band = 300.0;
|
||||
const edge = Color(0x66000000);
|
||||
const clear = Color(0x00000000);
|
||||
|
||||
canvas.drawRect(
|
||||
const Rect.fromLTWH(0, 0, w, band),
|
||||
Rect.fromLTWH(left, 0, w, band),
|
||||
Paint()
|
||||
..shader = ui.Gradient.linear(
|
||||
const Offset(0, 0), const Offset(0, band), [edge, clear]),
|
||||
);
|
||||
canvas.drawRect(
|
||||
const Rect.fromLTWH(0, h - band, w, band),
|
||||
Rect.fromLTWH(left, h - band, w, band),
|
||||
Paint()
|
||||
..shader = ui.Gradient.linear(
|
||||
const Offset(0, h - band), const Offset(0, h), [clear, edge]),
|
||||
);
|
||||
}
|
||||
|
||||
/// Charge bar under the active tank: the value the player is setting right now.
|
||||
void paintPowerBar(Canvas canvas, Offset tankPos, double power) {
|
||||
const w = 104.0;
|
||||
const h = 9.0;
|
||||
final rect = Rect.fromLTWH(tankPos.dx - w / 2, tankPos.dy + 12, w, h);
|
||||
canvas.drawRRect(
|
||||
RRect.fromRectAndRadius(rect, const Radius.circular(4)),
|
||||
Paint()..color = Colors.black.withValues(alpha: 0.55),
|
||||
);
|
||||
final fill = power.clamp(0.0, 1.0);
|
||||
final color = fill < 0.5
|
||||
? Palette.solarBase
|
||||
: fill < 0.85
|
||||
? const Color(0xFFFF8A3D)
|
||||
: Palette.stateDanger;
|
||||
canvas.drawRRect(
|
||||
RRect.fromRectAndRadius(
|
||||
Rect.fromLTWH(rect.left, rect.top, w * fill, h),
|
||||
const Radius.circular(4),
|
||||
),
|
||||
Paint()..color = color,
|
||||
);
|
||||
// Quarter marks make a value readable without text on the canvas.
|
||||
for (var i = 1; i < 4; i++) {
|
||||
final x = rect.left + w * i / 4;
|
||||
canvas.drawLine(
|
||||
Offset(x, rect.top + 1),
|
||||
Offset(x, rect.bottom - 1),
|
||||
Paint()
|
||||
..color = Colors.black.withValues(alpha: 0.35)
|
||||
..strokeWidth = 1,
|
||||
);
|
||||
}
|
||||
canvas.drawRRect(
|
||||
RRect.fromRectAndRadius(rect, const Radius.circular(4)),
|
||||
Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 1
|
||||
..color = Colors.white.withValues(alpha: 0.28),
|
||||
);
|
||||
}
|
||||
|
||||
/// Rubber band from the barrel pivot to the finger while pulling back.
|
||||
void paintPullBand(Canvas canvas, Offset pivot, Offset finger, double power) {
|
||||
final band = Paint()
|
||||
..color = Palette.solarLight.withValues(alpha: 0.45)
|
||||
..strokeWidth = 3
|
||||
..strokeCap = StrokeCap.round;
|
||||
// Dashed, so it never competes with the trajectory hint.
|
||||
final total = (finger - pivot).distance;
|
||||
if (total < 4) return;
|
||||
final dir = (finger - pivot) / total;
|
||||
var travelled = 0.0;
|
||||
while (travelled < total) {
|
||||
final from = pivot + dir * travelled;
|
||||
final to = pivot + dir * math.min(travelled + 12, total);
|
||||
canvas.drawLine(from, to, band);
|
||||
travelled += 22;
|
||||
}
|
||||
canvas.drawCircle(
|
||||
finger,
|
||||
14 + 10 * power,
|
||||
Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 2
|
||||
..color = Palette.solarLight.withValues(alpha: 0.5),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -101,8 +101,15 @@ class IronArcGame extends FlameGame {
|
||||
double aimPower = 0.6;
|
||||
bool _dragging = false;
|
||||
|
||||
/// Pull back to charge: full power at this many screen pixels of drag.
|
||||
static const double _maxDragPx = 260;
|
||||
Offset? _dragStart;
|
||||
Offset? _dragCurrent;
|
||||
|
||||
double _zoom = 1;
|
||||
double _camX = 0;
|
||||
double _camY = 0;
|
||||
bool _cameraReady = false;
|
||||
|
||||
int _terrainVersion = -1;
|
||||
Path? _terrainFill;
|
||||
@@ -196,19 +203,23 @@ class IronArcGame extends FlameGame {
|
||||
void beginAim(Offset screen) {
|
||||
if (!_match.isAiming) return;
|
||||
_dragging = true;
|
||||
_aimAt(screen);
|
||||
_dragStart = screen;
|
||||
_dragCurrent = screen;
|
||||
}
|
||||
|
||||
/// Updates the aim while dragging.
|
||||
void updateAim(Offset screen) {
|
||||
if (!_dragging) return;
|
||||
_aimAt(screen);
|
||||
_dragCurrent = screen;
|
||||
_aimFromDrag();
|
||||
}
|
||||
|
||||
/// Fires if a drag produced a valid shot.
|
||||
void releaseAim() {
|
||||
if (!_dragging) return;
|
||||
_dragging = false;
|
||||
_dragStart = null;
|
||||
_dragCurrent = null;
|
||||
if (!_match.isAiming) return;
|
||||
final angleMdeg = (aimAngle * 1000).round().clamp(1000, 89000);
|
||||
final powerQ16 = (aimPower * 65536).round().clamp(3277, 65536);
|
||||
@@ -225,17 +236,21 @@ class IronArcGame extends FlameGame {
|
||||
_pushHud();
|
||||
}
|
||||
|
||||
void _aimAt(Offset screen) {
|
||||
final world = screenToWorld(screen);
|
||||
final player = _match.current;
|
||||
final tank = Offset(_match.tankX(player).toDouble(),
|
||||
_match.tankY(player).toDouble() - 14);
|
||||
final dx = world.dx - tank.dx;
|
||||
final dy = world.dy - tank.dy;
|
||||
final distance = math.sqrt(dx * dx + dy * dy);
|
||||
aimPower = (distance / 250).clamp(0.05, 1.0);
|
||||
final radians = math.atan2(-dy, dx.abs());
|
||||
/// Slingshot semantics: pull away from the target, the shot leaves in the
|
||||
/// opposite direction. The drag *length* sets the power; aiming at the finger
|
||||
/// tip instead changed direction and power at the same time, which made the
|
||||
/// power impossible to dose.
|
||||
void _aimFromDrag() {
|
||||
final start = _dragStart;
|
||||
final now = _dragCurrent;
|
||||
if (start == null || now == null) return;
|
||||
final pull = now - start;
|
||||
// Dead zone: a twitchy finger must not move the reticle.
|
||||
if (pull.distance < 6) return;
|
||||
|
||||
final radians = math.atan2(pull.dy, pull.dx.abs());
|
||||
aimAngle = (radians * 180 / math.pi).clamp(1.0, 89.0);
|
||||
aimPower = (pull.distance / _maxDragPx).clamp(0.05, 1.0);
|
||||
_pushHud();
|
||||
}
|
||||
|
||||
@@ -246,28 +261,41 @@ class IronArcGame extends FlameGame {
|
||||
|
||||
void _updateCamera(double dt) {
|
||||
if (size.y <= 0 || size.x <= 0) return;
|
||||
// Fit height, but never crop the world horizontally more than necessary.
|
||||
final zoomForHeight = size.y / kWorldHeight;
|
||||
final zoomForWidth = size.x / kWorldWidth;
|
||||
_zoom = math.max(zoomForHeight, zoomForWidth);
|
||||
// The playfield must never be cropped vertically: a tank or a shot that
|
||||
// leaves the screen makes the game unplayable. So the world height always
|
||||
// fits. If the view is wider than the world (landscape), the world is
|
||||
// centred and the sides are letterboxed with sky.
|
||||
_zoom = size.y / kWorldHeight;
|
||||
_camY = 0;
|
||||
|
||||
final viewW = _viewWidthWorld;
|
||||
final focus = _match.isFlying
|
||||
? (_match.projectile()?.x.toDouble() ??
|
||||
_match.tankX(_match.current).toDouble())
|
||||
: _match.tankX(_match.current).toDouble();
|
||||
final desiredLeft = (focus - viewW / 2).clamp(0.0, math.max(0, kWorldWidth - viewW));
|
||||
// Smooth follow; instant on first frame.
|
||||
final t = _camX == 0 ? 1.0 : (dt * 5).clamp(0.0, 1.0);
|
||||
_camX += (desiredLeft - _camX) * t;
|
||||
_camX = _camX.clamp(0.0, math.max(0, kWorldWidth - viewW));
|
||||
|
||||
final bool worldFitsWidth = viewW >= kWorldWidth;
|
||||
final double desiredLeft = worldFitsWidth
|
||||
? (kWorldWidth - viewW) / 2
|
||||
: (focus - viewW / 2).clamp(0.0, kWorldWidth - viewW);
|
||||
|
||||
if (!_cameraReady) {
|
||||
_camX = desiredLeft;
|
||||
_cameraReady = true;
|
||||
} else {
|
||||
final t = (dt * 5).clamp(0.0, 1.0);
|
||||
_camX += (desiredLeft - _camX) * t;
|
||||
}
|
||||
if (!worldFitsWidth) {
|
||||
_camX = _camX.clamp(0.0, kWorldWidth - viewW);
|
||||
}
|
||||
}
|
||||
|
||||
/// Screen -> world pixels.
|
||||
Offset screenToWorld(Offset p) => Offset(p.dx / _zoom + _camX, p.dy / _zoom);
|
||||
Offset screenToWorld(Offset p) => Offset(p.dx / _zoom + _camX, p.dy / _zoom + _camY);
|
||||
|
||||
/// World -> screen pixels.
|
||||
Offset worldToScreen(Offset p) => Offset((p.dx - _camX) * _zoom, p.dy * _zoom);
|
||||
Offset worldToScreen(Offset p) => Offset((p.dx - _camX) * _zoom, (p.dy - _camY) * _zoom);
|
||||
|
||||
// ------------------------------------------------------------- rendering
|
||||
|
||||
@@ -277,7 +305,7 @@ class IronArcGame extends FlameGame {
|
||||
if (!isLoaded) return;
|
||||
canvas.save();
|
||||
canvas.scale(_zoom);
|
||||
canvas.translate(-_camX, 0);
|
||||
canvas.translate(-_camX, -_camY);
|
||||
|
||||
_drawSky(canvas);
|
||||
_drawTerrain(canvas);
|
||||
@@ -286,7 +314,7 @@ class IronArcGame extends FlameGame {
|
||||
_drawProjectile(canvas);
|
||||
if (_match.isAiming) _drawAim(canvas);
|
||||
_drawImpact(canvas);
|
||||
paintVignette(canvas);
|
||||
paintVignette(canvas, left: _camX, right: _camX + _viewWidthWorld);
|
||||
|
||||
canvas.restore();
|
||||
}
|
||||
@@ -300,17 +328,22 @@ class IronArcGame extends FlameGame {
|
||||
_terrainVersion = version;
|
||||
final heights = _match.terrain();
|
||||
_heightmap = heights;
|
||||
final fill = Path()..moveTo(0, heights[0].toDouble());
|
||||
final line = Path()..moveTo(0, heights[0].toDouble());
|
||||
// Flat continuation outside the world so landscape letterboxing still
|
||||
// shows ground instead of a hard edge.
|
||||
const ext = 700.0;
|
||||
final fill = Path()..moveTo(-ext, heights[0].toDouble());
|
||||
final line = Path()..moveTo(-ext, heights[0].toDouble());
|
||||
for (var i = 1; i < heights.length; i++) {
|
||||
final x = i * kSamplePx.toDouble();
|
||||
final y = heights[i].toDouble();
|
||||
fill.lineTo(x, y);
|
||||
line.lineTo(x, y);
|
||||
}
|
||||
line.lineTo(kWorldWidth + ext, heights[heights.length - 1].toDouble());
|
||||
fill
|
||||
..lineTo(kWorldWidth, kWorldHeight)
|
||||
..lineTo(0, kWorldHeight)
|
||||
..lineTo(kWorldWidth + ext, heights[heights.length - 1].toDouble())
|
||||
..lineTo(kWorldWidth + ext, kWorldHeight)
|
||||
..lineTo(-ext, kWorldHeight)
|
||||
..close();
|
||||
_terrainFill = fill;
|
||||
_terrainLine = line;
|
||||
@@ -333,6 +366,10 @@ class IronArcGame extends FlameGame {
|
||||
hpFrac: _match.tankHp(player).clamp(0, kTankMaxHp) / kTankMaxHp,
|
||||
isCurrent: player == _match.current && !_match.isPlayback,
|
||||
);
|
||||
// Charge bar sits under the tank that is about to fire.
|
||||
if (player == _match.current && _match.isAiming) {
|
||||
paintPowerBar(canvas, Offset(x, y), aimPower);
|
||||
}
|
||||
}
|
||||
|
||||
void _drawProjectile(Canvas canvas) {
|
||||
@@ -355,6 +392,15 @@ class IronArcGame extends FlameGame {
|
||||
dir: dir,
|
||||
power: aimPower,
|
||||
);
|
||||
final finger = _dragCurrent;
|
||||
if (_dragging && finger != null) {
|
||||
paintPullBand(
|
||||
canvas,
|
||||
tankPivot(Offset(x, y)),
|
||||
screenToWorld(finger),
|
||||
aimPower,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void _drawImpact(Canvas canvas) {
|
||||
|
||||
@@ -34,8 +34,18 @@ class Hud extends StatelessWidget {
|
||||
const SizedBox(width: 4),
|
||||
Text('${hud.wind > 0 ? '+' : ''}${hud.wind}',
|
||||
style: const TextStyle(fontSize: 13)),
|
||||
const SizedBox(width: 10),
|
||||
Icon(Icons.straighten,
|
||||
size: 14, color: const Color(0xFFA9B4C4)),
|
||||
const SizedBox(width: 3),
|
||||
Text('${hud.aimAngle.round()}°',
|
||||
style: const TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
// Power is the value players fight with - show it as a number
|
||||
// *and* as a bar, not only through the size of the aim dots.
|
||||
const SizedBox(height: 3),
|
||||
_PowerMeter(power: hud.aimPower),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -111,6 +121,7 @@ class Controls extends StatelessWidget {
|
||||
required this.onReplay,
|
||||
required this.onFlush,
|
||||
required this.onAd,
|
||||
this.compact = false,
|
||||
});
|
||||
|
||||
final MatchSession session;
|
||||
@@ -119,30 +130,52 @@ class Controls extends StatelessWidget {
|
||||
final VoidCallback onFlush;
|
||||
final VoidCallback onAd;
|
||||
|
||||
/// Landscape: the play area is short, so the controls lose their padding.
|
||||
final bool compact;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
_Action(icon: Icons.wifi_tethering, label: 'Online', onTap: onOnline),
|
||||
_Action(icon: Icons.replay, label: 'Replay', onTap: onReplay),
|
||||
_Action(
|
||||
icon: Icons.wifi_tethering,
|
||||
label: 'Online',
|
||||
onTap: onOnline,
|
||||
compact: compact),
|
||||
_Action(
|
||||
icon: Icons.replay,
|
||||
label: 'Replay',
|
||||
onTap: onReplay,
|
||||
compact: compact),
|
||||
_Action(
|
||||
icon: Icons.cloud_upload,
|
||||
label: session.queued > 0 ? 'Senden (${session.queued})' : 'Senden',
|
||||
onTap: onFlush,
|
||||
compact: compact,
|
||||
),
|
||||
_Action(icon: Icons.ondemand_video, label: 'Ad', onTap: onAd),
|
||||
_Action(
|
||||
icon: Icons.ondemand_video,
|
||||
label: 'Ad',
|
||||
onTap: onAd,
|
||||
compact: compact),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _Action extends StatelessWidget {
|
||||
const _Action({required this.icon, required this.label, required this.onTap});
|
||||
const _Action({
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.onTap,
|
||||
this.compact = false,
|
||||
});
|
||||
|
||||
final IconData icon;
|
||||
final String label;
|
||||
final VoidCallback onTap;
|
||||
final bool compact;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -153,13 +186,14 @@ class _Action extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: compact ? 10 : 14, vertical: compact ? 6 : 12),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(icon, size: 18),
|
||||
const SizedBox(width: 6),
|
||||
Text(label, style: const TextStyle(fontSize: 13)),
|
||||
Icon(icon, size: compact ? 16 : 18),
|
||||
SizedBox(width: compact ? 4 : 6),
|
||||
Text(label, style: TextStyle(fontSize: compact ? 12 : 13)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -168,6 +202,48 @@ class _Action extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Slim power bar with a percentage label, shared by the HUD.
|
||||
class _PowerMeter extends StatelessWidget {
|
||||
const _PowerMeter({required this.power});
|
||||
|
||||
final double power;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final pct = (power.clamp(0.0, 1.0) * 100).round();
|
||||
final color = pct < 50
|
||||
? const Color(0xFFFFB347)
|
||||
: pct < 85
|
||||
? const Color(0xFFFF8A3D)
|
||||
: const Color(0xFFFF5A5F);
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.bolt, size: 14, color: Color(0xFFA9B4C4)),
|
||||
const SizedBox(width: 3),
|
||||
SizedBox(
|
||||
width: 74,
|
||||
height: 6,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
child: LinearProgressIndicator(
|
||||
value: power.clamp(0.0, 1.0),
|
||||
minHeight: 6,
|
||||
color: color,
|
||||
backgroundColor: const Color(0xFF1B2C44),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
SizedBox(
|
||||
width: 34,
|
||||
child: Text('$pct %', style: const TextStyle(fontSize: 12)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _Pill extends StatelessWidget {
|
||||
const _Pill({
|
||||
required this.label,
|
||||
@@ -216,7 +292,7 @@ class HintBubble extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final text = hud.phase == 1
|
||||
? 'Projektil im Flug…'
|
||||
: 'Ziehen zum Zielen · Loslassen zum Schießen';
|
||||
: 'Zurückziehen zum Spannen · Loslassen zum Schießen';
|
||||
return Center(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
|
||||
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 0.9.0+13
|
||||
version: 0.9.1+14
|
||||
|
||||
environment:
|
||||
sdk: ^3.13.4
|
||||
|
||||
@@ -7,8 +7,9 @@ import 'fake_match.dart';
|
||||
|
||||
/// Golden tests render the game headlessly (no device, no native library).
|
||||
/// Update with: flutter test --update-goldens
|
||||
Future<void> pumpGame(WidgetTester tester, IronArcGame game) async {
|
||||
await tester.binding.setSurfaceSize(const Size(420, 840));
|
||||
Future<void> pumpGame(WidgetTester tester, IronArcGame game,
|
||||
{Size surface = const Size(420, 840)}) async {
|
||||
await tester.binding.setSurfaceSize(surface);
|
||||
addTearDown(() => tester.binding.setSurfaceSize(null));
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
@@ -46,4 +47,17 @@ void main() {
|
||||
matchesGoldenFile('goldens/after_impact.png'),
|
||||
);
|
||||
});
|
||||
|
||||
// Landscape used to zoom to the view *width*, which cropped the world top and
|
||||
// bottom without any vertical panning - both tanks were off-screen and the
|
||||
// match was unplayable. The camera now always fits the world height, so this
|
||||
// golden is the regression guard for that bug.
|
||||
testWidgets('landscape shows the whole playfield', (tester) async {
|
||||
final game = IronArcGame(matchFactory: FakeMatch.aiming);
|
||||
await pumpGame(tester, game, surface: const Size(840, 420));
|
||||
await expectLater(
|
||||
find.byType(MaterialApp),
|
||||
matchesGoldenFile('goldens/landscape.png'),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 347 KiB After Width: | Height: | Size: 345 KiB |
|
Before Width: | Height: | Size: 313 KiB After Width: | Height: | Size: 315 KiB |
|
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 323 KiB |
|
After Width: | Height: | Size: 247 KiB |
@@ -264,6 +264,28 @@ wenn käufliche Vorteile den Server berühren.
|
||||
**Löschpfad:** keine Accounts → Play-Anforderung über Datenlöschung (E-Mail vorausgefüllt)
|
||||
plus „Lokale Daten löschen“ (Warteschlange, Replays, Geräte-ID) erfüllt.
|
||||
|
||||
## M7f — Spielbarkeit: Kraft dosieren + Querformat (erledigt 2026-10-25)
|
||||
|
||||
**Zwei Feldbefunde aus echtem Spielen:**
|
||||
|
||||
1. *Schusskraft schwer einzustellen und nicht ablesbar.* Die Kraft hing an der absoluten Distanz
|
||||
vom Panzer (250 Welt-px = 100 %), und angezeigt wurde sie nur über die Größe der Zielpunkte.
|
||||
2. *Querformat unspielbar.* Die Kamera rechnete `zoom = max(fitHeight, fitWidth)`. Im Querformat
|
||||
führte das FitWidth dazu, dass die Welt **vertikal abgeschnitten** wurde – ohne vertikales
|
||||
Pannen lagen beide Panzer außerhalb des Bildes.
|
||||
|
||||
| Änderung | Details |
|
||||
|---|---|
|
||||
| Zielen | Zurückziehen statt auf den Finger zeigen: Zuglänge/260 px = Kraft, Zugrichtung = Schussrichtung (Gegenseite). 6-px-Totzone gegen Zittern. |
|
||||
| Rückmeldung | Gummiband vom Turm zum Finger, Kraftbalken (104×9 Welt-px, Viertelmarken) unter dem aktiven Panzer, HUD-Zeile mit Winkel und Kraftbalken + Prozentwert |
|
||||
| Kamera | `zoom = fitHeight` immer; bei breiterer Ansicht wird die Welt zentriert und die Ränder mit Himmel/Bergen/Boden gefüllt (Bergketten gekachelt, Bodenkante fortgesetzt) |
|
||||
| Layout | Im Querformat kleinere Abstände und kompakte Bedienknöpfe |
|
||||
| Regression | Neuer Golden-Test `landscape.png` (840×420) – er zeigt beide Panzer und hätte den Fehler gefunden |
|
||||
|
||||
**Verifikation:** 18 Tests grün; auf dem Gerät Hoch- und Querformat durchgespielt (Schuss feuert,
|
||||
Kraft 47 % bzw. 54 % gemessen), keine `RenderFlex overflowed`-Meldung im Logcat,
|
||||
`perf.sh`: **60,0 fps, 0,0 % Jank** (p90 16,9 ms).
|
||||
|
||||
## Nächste Schritte (aktualisiert)
|
||||
|
||||
1. `bundletool build-apks --connected-device` aus `~/exports/iron-arc-0.7.0.aab` → Install → Smoke.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
| Feld | Wert |
|
||||
|---|---|
|
||||
| Paket | `de.softwareapp_hb.ironarc` |
|
||||
| Version | 0.8.1 (versionCode 11) |
|
||||
| Version | 0.9.1 (versionCode 14) |
|
||||
| Zielgruppe | 13+, **nicht** im Families-Programm |
|
||||
| Enthält Werbung | Ja – AdMob SDK ist eingebaut (App ID `ca-app-pub-3909261635234286~8769927442`) |
|
||||
| In-App-Käufe | Ja (geplant ab M7) |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Play Console — Copy-Paste-Blatt
|
||||
|
||||
Stand: 2026-10-25, Build **0.9.0 (13)**. Alle Angaben sind gegen den Release-Build geprüft
|
||||
Stand: 2026-10-25, Build **0.9.1 (14)**. Alle Angaben sind gegen den Release-Build geprüft
|
||||
(Berechtigungen per `aapt2 dump permissions`, Netzwerkziele per Code-Grep, Asset-Größen per
|
||||
`PIL`). Wenn sich der Build ändert, muss dieses Blatt mitwandern.
|
||||
|
||||
@@ -84,12 +84,10 @@ IRON ARC ist bewusst klein: ein Duell, ein Bildschirm, keine Ablenkung.
|
||||
### Was ist neu (max. 500 Zeichen)
|
||||
|
||||
```
|
||||
0.9.0
|
||||
• „Werbung entfernen“ als einmaliger Kauf (Play Billing)
|
||||
• Käufe wiederherstellen direkt in den Einstellungen
|
||||
• Lokale Daten lassen sich jetzt in der App löschen
|
||||
• Neue Spielgrafik: Dämmerungshimmel, Bergketten mit Tiefenwirkung, detaillierte Panzer
|
||||
• Startbildschirm ohne weißes Aufblitzen
|
||||
0.9.1
|
||||
• Schusskraft jetzt präzise: Zurückziehen zum Spannen, Kraftbalken und Prozentwert sichtbar
|
||||
• Querformat spielbar: die Kamera zeigt das ganze Spielfeld
|
||||
• Kompaktere Bedienelemente im Querformat
|
||||
```
|
||||
|
||||
---
|
||||
@@ -126,7 +124,7 @@ WHAT MAKES IT DIFFERENT
|
||||
• No grind, no timers: open it and play. No energy, no waiting.
|
||||
|
||||
HOW TO PLAY
|
||||
1. Drag: set direction and power - the dotted line previews the arc.
|
||||
1. Pull back: the drag length sets the power, the drag direction the shot.
|
||||
2. Release: the shell flies, digs in, reshapes the ground.
|
||||
3. Answer: your opponent takes the turn. Alternate until one tank is out of armour.
|
||||
A match rarely takes longer than three minutes - perfect for a lunch break.
|
||||
@@ -154,12 +152,10 @@ IRON ARC is deliberately small: one duel, one screen, no distractions.
|
||||
### What's new (max. 500)
|
||||
|
||||
```
|
||||
0.9.0
|
||||
• "Remove ads" as a one-time purchase (Play Billing)
|
||||
• Restore purchases directly in Settings
|
||||
• Local data can now be deleted inside the app
|
||||
• New game art: dusk sky, layered ridges, detailed tanks
|
||||
• Splash screen without the white flash
|
||||
0.9.1
|
||||
• Precise shot power: pull back to charge, with a visible power bar and percentage
|
||||
• Playable in landscape: the camera now shows the whole playfield
|
||||
• More compact controls in landscape
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 248 KiB |
|
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 198 KiB |