webdevpuneet.com

Pocket Artillery – Free HTML, CSS & JS Tank Duel Game

Pocket Artillery Tank Duel · Games · Plain HTML, CSS & JS · Live preview

CategoryGames

About this UI Snippet

Pocket Artillery — Drag-to-Aim, Destructible Terrain, a Shuffled Hand of Weapons & an AI That Simulates Its Shots

Screenshot of the Pocket Artillery Tank Duel snippet rendered live

Artillery duels are one of the oldest game ideas on the PC: two tanks, a hill between them, and a guess at angle and power. Pocket Artillery is a reimagined game inspired by the classic Pocket Tanks, rebuilt from scratch with its own look, weapons and code. This snippet is a bright, light-themed canvas version you can play at once: 6, 10 or 15 shots each (10 by default), a hand of one weapon per shot dealt from a pool of 27 when the match starts (each fired only once), wind on the Hard level, birds, a plane and wildlife in the sky, big explosions that fit each weapon, and terrain that really crumbles when it is hit. Careful where you aim: a blast that lands on your own tank costs you points. Pull back on the field like a slingshot to aim, drive your tank a short way to find a better spot, play the CPU on three levels, or hand the device to a friend for a two-player duel. Pick your terrain (Meadow, Desert, Snow or Night), try the Valley map, and use the streak counter on the Daily map give you a reason to come back tomorrow.

Terrain as a height map you can carve

The ground is one array, ground[x], holding the surface height of every pixel column. A blast calls crater(cx, cy, r), which lowers each column inside the circle to the bottom of that circle, and the Dirt Ball does the opposite with addDirt(). Because the map is just numbers, collision is a single lookup (s.y >= ground[Math.round(s.x)]), the tanks settle by reading the same array, and the soil and grass are drawn from it every frame.

Ballistics with wind on a fixed time step

Each shell gets a velocity from the angle and power (speed = power * 0.085), then gravity pulls vy down and the wind adds a small sideways push each step (only on Hard; Easy, Normal and 2-player have no wind, so the same angle and power always land in the same spot). The loop runs on a 60 Hz accumulator, so the flight is identical on a 144 Hz monitor, and the same step rule is reused by the CPU when it plans a shot.

A CPU that tests shots before it fires

On its turn the computer tries about 1,300 angle and power pairs through simulate(), a copy of the physics that stops at the first terrain hit, and keeps the pair that lands closest to your tank. Then it adds a random error, with an occasional bigger slip. The three levels only change those numbers: Easy errs by about 6 degrees and slips often, Normal by 2.4, Hard by under 1, so the same code gives a beatable opponent or a sharp one.

Scoring by closeness

A blast scores pts * (1 - distance / reach) for the enemy tank, so a direct hit is worth the full value and a near miss still pays a little. Each weapon trades radius against points: the Mini Nuke covers a huge area for fewer points, and the Dirt Ball scores nothing but buries a tank: the buried tank must fire a Dirt Remover first, because any other shot goes off on its own tank.

Friendly fire

The same formula runs for your own tank. If a blast reaches the tank that fired it, the shooter loses pts * (1 - distance / reach) points (at least 5, and weapons worth 0 count as 50), a red "Friendly fire!" label floats up, and the score is allowed to go below zero. A burning Napalm patch costs 12 points per tick if you stand in your own flames.

Weapons with their own behaviour

The Roller lands, then runs along the height map, faster downhill, until it meets a wall, a tank or runs out of steps. The Digger carves five stacked craters straight down and scores only on a tight radius. The Triple fires three shells 7 degrees apart, the Bouncer hops twice before it explodes, and the Napalm leaves a flame patch that keeps scoring while an enemy tank stands in it. The Cluster splits into five bomblets at the top of its arc, the Zapper arcs lightning to a tank within 130 pixels, the Homing dart locks on when it passes close to its target, the Sticky bomb glues itself to whatever it touches and blows up after a blink, the light Balloon is carried far by the wind, and Meteors rain from the sky around the impact. Six more were added for fun: the Firework bursts into ten coloured sparks at the top of its arc, the Popcorn pops four times along the ground, the Mole lands and burrows toward the enemy digging a trench, the Snowball rolls and grows bigger as it goes, the Black Hole swallows a huge crater with a spinning vortex, and the Boomerang curves back toward you in flight. Each one is a few lines in fire(), step() or explode(), keyed by its id.

Explosions that match the weapon

A visual-only layer draws a different blast for each weapon family. Missiles and rollers get a fireball with rays and embers, the Big Boom and Mini Nuke send out concentric shockwave rings (the nuke adds a white flash), the Zapper throws radial lightning with glowing discs, each Firework spark leaves rainbow streaks and a ring of beads, the Snowball raises ice spikes, and the Dirt Ball sprays dust. The real blast is still just a crater and a score, so these effects can be changed freely.

A fresh hand every match

At the start of a match the weapon buttons flicker through random names, then settle on ten weapons dealt from the pool of 27 with a seeded shuffle. You pick 6, 10 or 15 shots each on the start menu (the Daily map is always 10) and the hand has one weapon per shot, so every weapon in it gets fired once. The Daily map uses the date as the seed, so everyone gets the same map, theme and hand that day.

Move, bury and dig out

Hold the move buttons or the A and D keys to drive up to 50 pixels a turn. Slopes that are too steep, craters, the field edge and the other tank all block the move. A Dirt Ball that lands on a tank buries it, and a buried tank that fires anything but the Dirt Remover blows itself up for a 40 point penalty, so the Remover digs a trench in the fired direction to set it free. A hand with a Dirt Ball always includes a Remover.

A sky with birds, four themes and textured soil

Birds flap across the sky, none on Easy, one on Normal and two on Hard, and a shell that touches one is wasted. A little propeller plane drifts past near the high clouds, and a shell that hits it shoots it down: it tumbles, trailing smoke, and crashes in a fireball. If it lands on a tank, the shooter scores 100 points when it is the enemy tank and loses 100 when it is their own. Now and then a deer (Meadow), camel (Desert) or polar bear (Snow) walks in at the edge of the field and watches the battle. Blasts and shells can kill it; it vanishes and walks back in later, with no score change. The seed picks one of four colour themes unless you choose a terrain (Meadow, Desert, Snow or Night with twinkling stars) and sometimes a Valley map with high ridges and a deep dip. The soil texture is drawn once per theme to a hidden canvas and clipped to the live terrain, so craters cut straight through it.

Drag to aim, or play two-player

On the field, a pointer drag measures the pull from the tank: the direction gives the angle and the length gives the power, so it feels like a slingshot and works the same with a mouse or a finger. In the two-player mode the same controls act on whichever tank is up (cur()), and the CPU turn is simply skipped.

What's included

Features

Destructible terrain stored as a one-dimensional height map, carved by craters and raised by dirt
Wind that changes every turn on Hard and bends the shells, shown in a badge on the field; Easy, Normal and 2-player are calm
A shuffled hand of ten weapons from a pool of 27, each usable once, 6, 10 or 15 shots per player: Missile, Big Boom, Triple, Bouncer, Mini Nuke, Roller, Digger, Napalm, Dirt Ball, Cluster, Zapper, Homing, Sticky, Balloon, Meteors, Dirt Remover, Firework, Popcorn, Mole, Snowball, Black Hole, Boomerang, Laser Strike, Quake, Magnet, Volcano and Teleporter
Bury and dig out: a Dirt Ball that lands on a tank buries it, a buried tank that fires anything else blows itself up (-40 points), and the Dirt Remover digs a trench in the fired direction to free it; a hand with a Dirt Ball always includes a Dirt Remover
Creative weapons: Cluster splits into bomblets, Zapper arcs lightning to a nearby tank, Homing locks on when it passes close to the enemy, Sticky glues to a tank and blows up, Balloon floats down in slow motion, Meteors rain from the sky
Friendly fire: any weapon whose blast reaches your own tank costs you points, and the score can go below zero
Dramatic blast effects per weapon: fireballs with embers, shockwave rings, lightning, rainbow streaks, ice spikes and dust
A plane you can shoot down: it tumbles, crashes in a fireball, and scores 100 points if it lands on the enemy tank (or costs 100 on your own)
Wildlife that matches the terrain (deer, camel or polar bear) walks in to watch the battle; blasts can kill it and it returns later
Drag-to-aim on the field, slingshot style, plus sliders and keyboard controls
Easy level also keeps a faint ghost of your previous shot on the field, like Worms, so the next aim can be corrected from it
Wind badge shows one chevron per wind point in the direction it blows
Easy level shows a dotted trajectory preview while dragging, so new players learn what angle, power and wind do
Two-player hot-seat mode on one device, or a CPU with Easy, Normal and Hard levels
CPU opponent that simulates around 1,300 shots, picks the closest and adds a level-based human-like error
Distance-based scoring, so near misses still earn points
Daily map from a date seed plus a random map button, using a small seeded random generator
Tank movement: hold the move buttons or A and D for up to 50 pixels per turn, blocked by steep slopes, craters, the edges and the other tank; the CPU shuffles a little on Normal and Hard
Birds flap across the sky (none on Easy, one on Normal, two on Hard); a shell that hits one is wasted, the bird tumbles down with feathers, and the next turn begins
Textured ground: soil strata, speckles and pebbles drawn once to a hidden canvas per theme and clipped to the terrain, plus grass tufts that follow the surface
Choose your terrain (Random, Meadow, Desert, Snow or Night) and your weapons (random, or pick up to ten that both tanks share; the Daily map stays fixed for everyone): four colour themes (Meadow, Desert, Snow, Night with twinkling stars) and a Valley map type with high ridges and a deep dip, all chosen from the map seed
Daily streak and the best daily score kept in localStorage, so there is a reason to come back tomorrow
Fixed 60 Hz physics step, so shell flight is the same on every screen refresh rate
Bright light theme with a sky, clouds and soft hills, plus particles, rings and screen shake
Mouse, touch and keyboard controls, Web Audio sound with a mute button, best score in localStorage

Step by step

How to Use

  1. 1
    Start a matchChoose "vs CPU" (Easy, Normal or Hard) or "2 players", pick a terrain (Random, Meadow, Desert, Snow or Night), choose Random weapons or pick up to ten yourself (both tanks get the same ones), then press "Play" for a map or "Daily map" for the same map everyone gets today. You are the coral tank on the left.
  2. 2
    Set angle and powerDrag on the field away from your tank like a slingshot (the pull sets both), or use the sliders, or the arrow keys (Shift moves five at a time). A dotted line shows where the barrel points, and on Easy a dotted arc previews the first part of the flight while you drag and a faint ghost line shows where your previous shot went.
  3. 3
    Move your tankHold the left and right arrow buttons beside the Fire button, or the A and D keys, to drive up to 50 pixels each turn. Steep slopes, craters (holes), the field edge and the other tank block you, and the Move number shows how much is left.
  4. 4
    Read the windOn Hard the Wind badge at the top shows the direction and strength for this turn (Easy, Normal and 2-player have no wind, so the same angle and power always land in the same spot). Aim a little into it so the shell drifts back onto the target.
  5. 5
    Pick a weapon and fireThe weapon list shuffles at the start of every match and deals you ten of 27 weapons (the Daily map deals everyone the same hand). Choose one (keys 1 to 9 and 0, hover for a tip) and press "Fire!" or Space. Each weapon can be used once per match, and you get one shot per weapon (6, 10 or 15, chosen on the start menu), so every weapon in your hand gets used once.
  6. 6
    Score the closest blastWatch your own tank: a blast that reaches it costs you points, and the score can go negative. Shoot down the plane for a bonus if it crashes on the enemy. After the last shot the higher score wins. Your best score is saved in the browser. Finish the Daily map on consecutive days to build a streak.

Real-world uses

Common Use Cases

Quick arcade mini-game for a site
A match takes about two minutes and needs no assets or libraries, so it fits an Easter egg page, a 404 screen or a "while you wait" corner.
Teaching projectile motion
Angle, power, gravity and wind are all visible and adjustable, which makes the game a hands-on demo for a physics or maths lesson.
Reference for height-map terrain
Carving and filling a column array is the simplest way to get destructible ground, and the code shows it in under 20 lines.
Example of an AI that plans by simulation
The CPU does not cheat: it runs the same physics offline, scores each result and picks the best, a pattern reused in many turn-based games.
Branded reskin for a campaign
Swap the tank colours, the sky and the weapon names for brand versions to make a "beat our mascot" promo game.
Local two-player duel on one screen
The built-in 2 players mode hands the same controls to each tank in turn, which suits a classroom, a break room or a phone passed between friends.
Daily challenge with a streak
The Daily map gives everyone the same map and weapon hand, and the saved streak and best daily score show a simple way to bring visitors back each day without a server.
Related: Tank Arena
See the Tank Arena for a top-down tank shooter that pairs well with this turn-based duel.

Got questions?

Frequently Asked Questions

The ground is an array with one surface height per pixel column. A blast lowers every column inside its circle to the bottom of that circle, so the hole is round, and the tanks then read the new height and drop down into it.

It finds the best angle and power by simulating many shots, then adds a random error of a couple of degrees, and now and then a bigger one. Lower the error values in LEVELS for a harder opponent or raise them for an easier one.

Each physics step adds wind * 0.0025 to the shell's horizontal speed. The wind is a whole number from -5 to 5 picked from the seeded generator at the start of every turn, and it is forced to 0 everywhere except the Hard CPU level.

Finishing a vs-CPU match on the Daily map stores the date and score in localStorage. If the last finished daily was yesterday the streak goes up by one, otherwise it restarts at 1. Two-player matches do not count.

If a blast reaches the tank that fired it, the shooter loses points using the same distance formula as a hit on the enemy, with a minimum of 5. Weapons that normally score nothing count as 50. The score can go below zero.

Yes. A shell that touches the plane shoots it down; if it crashes onto a tank, the shooter gets 100 points for the enemy tank or loses 100 for their own. Blasts can also kill the animal at the field edge, which returns later.

It makes a small crater, then adds a fire object at that spot that lasts 150 steps. Every 25 steps an enemy tank within about 30 pixels of it gives the shooter 12 points, and the next turn waits until the flames die out.

Add an object to the THEMES array with a name, two sky colours, a sun colour, hill colour, two soil colours, a grass colour, a cloud colour and a text colour. Themes change colours only, so no other code needs to change.

The number of birds depends on the level: none on Easy, one on Normal and in 2-player, two on Hard. Each bird is a small object with a position, speed and flap phase. If a shell comes within about 12 pixels, the shell is marked dead without exploding, the bird switches to a falling state with feather particles, and the turn moves on. It respawns off screen after it drops.

While a move button or the A or D key is held, the active tank moves 1.5 pixels per physics step, up to 50 pixels per turn. A move is refused if the new column is more than 3 pixels higher or lower, if the spot is a hole (clearly lower than the ground 12 pixels away on both sides), if it leaves the field, or if it would come within 36 pixels of the other tank. The tank then reads the height of its new column, so it follows the terrain.

When a match starts, dealHand(seed) shuffles the POOL array with a seeded Fisher-Yates shuffle and keeps the first ten. The buttons flicker through random names for about a second as a shuffle effect, then show the hand. Because the Daily map uses the date as the seed, everyone gets the same hand that day.

A Dirt Ball that lands within its blast radius of a tank sets that tank buried flag and draws a mound over it. While buried, any weapon except the Dirt Remover explodes on the tank itself, costs the shooter 40 points and clears the dirt. The Dirt Remover carves a short trench along the barrel direction and clears the flag. A nearby blast from a normal weapon also frees a buried tank. The hand dealer always adds a Dirt Remover when the hand contains a Dirt Ball.

It seeds the random generator with today's date as a number, so the terrain, the theme, the tank positions and the wind sequence are the same for everyone that day.

Add an entry to the POOL array with a name, blast radius, points and colour. Special behaviour such as the Triple spread, the Bouncer hops, the Roller run or the Digger tunnel lives in fire(), step() and explode(), keyed by the weapon id. The weapon buttons are built from the array, so a new entry shows up by itself.

Edit the LEVELS array: err is the aim error in degrees and slip is the chance of a bigger mistake. Easy, Normal and Hard just select one of the three rows, and the search over angles and powers stays the same.

A pointerdown on the canvas starts a drag. The vector from the pointer to the tank gives the angle (atan2) and its length divided by 1.3 gives the power, and both are clamped. Pointer events and touch-action: none make it work for mouse and touch.

Copy & paste

Source Code

<div class="pa-wrap menu" id="pa-wrap">
  <div class="pa-header">
    <h2>Pocket Artillery</h2>
    <div class="pa-scores">
      <span class="pa-you"><span id="pa-name-you">You</span> <strong id="pa-score-you">0</strong></span>
      <span class="pa-shot" id="pa-shot">Shot 1 / 10</span>
      <span class="pa-cpu"><span id="pa-name-cpu">CPU</span> <strong id="pa-score-cpu">0</strong></span>
    </div>
  </div>

  <div class="pa-stage">
    <canvas id="pa-canvas" aria-label="Artillery battlefield with two tanks"></canvas>
    <div class="pa-overlay" id="pa-overlay">
      <p class="pa-title" id="pa-title">Pocket Artillery</p>
      <p class="pa-sub" id="pa-sub">Drag on the field to aim. Pick 6, 10 or 15 shots each, closest blasts score most.</p>
      <div class="pa-opts">
        <div class="pa-seg" id="pa-mode" role="group" aria-label="Mode">
          <button type="button" data-v="cpu" class="on">vs CPU</button>
          <button type="button" data-v="two">2 players</button>
        </div>
        <div class="pa-seg" id="pa-diff" role="group" aria-label="CPU level">
          <button type="button" data-v="0">Easy</button>
          <button type="button" data-v="1" class="on">Normal</button>
          <button type="button" data-v="2">Hard</button>
        </div>
        <div class="pa-seg" id="pa-shots" role="group" aria-label="Shots each">
          <button type="button" data-v="6">6 shots</button>
          <button type="button" data-v="10" class="on">10 shots</button>
          <button type="button" data-v="15">15 shots</button>
        </div>
        <div class="pa-seg" id="pa-terrain" role="group" aria-label="Terrain">
          <button type="button" data-v="-1" class="on">Random</button>
          <button type="button" data-v="0">Meadow</button>
          <button type="button" data-v="1">Desert</button>
          <button type="button" data-v="2">Snow</button>
          <button type="button" data-v="3">Night</button>
        </div>
        <div class="pa-seg" id="pa-wmode" role="group" aria-label="Weapons">
          <button type="button" data-v="random" class="on">Random weapons</button>
          <button type="button" data-v="pick" id="pa-wpick">Choose weapons</button>
        </div>
      </div>
      <div class="pa-btns">
        <button class="pa-btn" id="pa-play" type="button">Play</button>
        <button class="pa-btn pa-btn-alt" id="pa-daily" type="button">Daily map</button>
      </div>
      <button class="pa-btn pa-btn-share" id="pa-share" type="button" hidden>Share result</button>
      <p class="pa-best" id="pa-best"></p>
    </div>
    <div class="pa-pick" id="pa-pick" role="dialog" aria-label="Choose your weapons" hidden>
      <button class="pa-x" id="pa-pick-x" type="button" aria-label="Close weapon picker">&times;</button>
      <p class="pa-pick-title">Choose your weapons <span id="pa-pick-n">0 / 10</span></p>
      <p class="pa-pick-sub">Pick up to one weapon per shot. Both tanks get the same weapons. Anything you leave out is picked at random. A Dirt Ball always comes with a Dirt Remover.</p>
      <div class="pa-pick-grid" id="pa-pick-grid"></div>
      <div class="pa-btns">
        <button class="pa-btn pa-btn-alt" id="pa-pick-clear" type="button">Clear</button>
        <button class="pa-btn" id="pa-pick-done" type="button">Done</button>
      </div>
    </div>
  </div>
  <div class="pa-sharebox" id="pa-sharebox" hidden>
    <span id="pa-sharemsg">Share your result:</span>
    <button type="button" id="pa-copyimg">Copy image</button>
    <a id="pa-dl" download="pocket-artillery-result.png">Download image</a>
    <button type="button" id="pa-more" hidden>More&hellip;</button>
    <a id="pa-sh-wa" target="_blank" rel="noopener">WhatsApp</a>
    <a id="pa-sh-x" target="_blank" rel="noopener">X</a>
    <a id="pa-sh-fb" target="_blank" rel="noopener">Facebook</a>
    <button type="button" class="pa-x pa-x-share" id="pa-share-x" aria-label="Close share options">&times;</button>
  </div>

  <div class="pa-panel" id="pa-panel">
    <label class="pa-ctl"><span>Angle <strong id="pa-angle-val">55</strong>&deg;</span>
      <input id="pa-angle" type="range" min="0" max="180" value="55" aria-label="Angle">
    </label>
    <label class="pa-ctl"><span>Power <strong id="pa-power-val">60</strong></span>
      <input id="pa-power" type="range" min="10" max="100" value="60" aria-label="Power">
    </label>
    <div class="pa-move" role="group" aria-label="Move tank">
      <button type="button" id="pa-left" aria-label="Move left">&#9664;</button>
      <span>Move <strong id="pa-fuel">50</strong></span>
      <button type="button" id="pa-right" aria-label="Move right">&#9654;</button>
    </div>
    <button class="pa-fire" id="pa-fire" type="button">Fire!</button>
  </div>
  <div class="pa-weapons" id="pa-weapons" role="group" aria-label="Weapons"></div>
  <div class="pa-foot">
    <span class="pa-keys">Drag the field or arrows to aim &middot; A / D: move &middot; Space: fire &middot; 1-9, 0: weapon</span>
    <span class="pa-touch">Drag on the field to aim &middot; hold &#9664; &#9654; to move</span>
    <button class="pa-mute" id="pa-mute" type="button" aria-pressed="false">Sound on</button>
  </div>
</div>

Extend with AI

Take This Snippet Further With AI

Paste this snippet's HTML, CSS, and JS into an AI coding assistant like Claude and ask it to explain how the height-map terrain, the fixed-step physics and the simulate() function the CPU uses fit together, then ask for a new weapon such as a freeze ray that locks a tank for a turn, or a campaign of maps with rising CPU levels.

Prompt to recreate it

Copy this into your AI assistant of choice to build the effect from scratch, or as a jumping-off point for your own variant:

text
Build a turn-based artillery tank duel with the HTML5 Canvas API in plain HTML, CSS and JavaScript, no frameworks and no audio files.
- Light, bright look: pale sky gradient, clouds, soft hills, green-topped soil, one coral tank (player, left) and one blue tank (CPU, right).
- Store terrain as a height array with one value per pixel column. Explosions carve a circular crater by lowering columns; a Dirt Ball weapon raises them. Tanks sit on the surface and settle after each blast.
- Controls: Angle slider 0-180, Power slider 10-100, Fire button, arrow keys to aim (Shift for bigger steps), Space to fire, keys 1-9 and 0 to choose a weapon, and slingshot-style drag on the field (pull back from the tank: direction = angle, length = power). Works with touch.
- Physics on a fixed 60 Hz step: shell velocity from angle and power, constant gravity, and a per-turn wind from -5 to 5 shown in a badge (wind only on the Hard level).
- A pool of 27 weapons; at the start of each match the weapon buttons flicker through random names (a shuffle animation) and settle on a hand of ten, the Daily map dealing everyone the same hand. Hover shows a tip. Each usable once per match. Extra pool weapons: Cluster (splits into 5 bomblets at the apex), Zapper (lightning to a tank within 130 px, +25), Homing (normal arc, locks on within 60 px of the enemy), Sticky (sticks to a tank or the ground, blinks, explodes after about 1.4 s), Balloon (floats down the standard arc in slow motion), Meteors (four meteors fall around the impact). Base weapons: Missile, Big Boom (large radius), Triple (three shells spread by 7 degrees), Bouncer (two hops), Mini Nuke (huge crater, fewer points), Roller (rolls along the ground after landing), Digger (five stacked craters straight down), Napalm (small blast that leaves a burning patch scoring 12 points every 25 frames an enemy tank stands in it), Dirt Ball (no points, but it buries a tank that lands inside its radius). Also a Dirt Remover weapon: a buried tank that fires anything else blows up on itself for a 40 point penalty, the Dirt Remover digs a trench along the barrel direction and frees it, and a dealt hand with a Dirt Ball always includes a Dirt Remover.
- Every weapon flies the same standard arc, so the same angle and power (and wind) always land on the same spot; weapons only differ in what happens at the apex or on landing (Balloon is the same arc in slow motion, Boomerang swings out and returns to it, Homing only locks on near the enemy).
- 6, 10 or 15 shots each (picked on the start menu, 10 by default, the Daily map always 10), alternating, one per weapon in the hand. Score the enemy by blast distance: pts * (1 - distance / (radius + 13)), with floating +points text.
- CPU opponent with Easy, Normal and Hard levels (aim error and slip chance): pick an unused weapon, try many angle and power pairs with an offline simulate() copy of the physics, choose the closest landing to the player, add a random error. Also a 2 players mode on one device that swaps the controls between the tanks.
- On the Easy level only, while dragging, draw a short dotted trajectory preview using the same gravity and wind as a real shell.
- On Easy, also keep a faint dashed ghost arc of the previous shot visible during the next aim. The wind badge shows one chevron per wind point in the wind direction.
- Give the soil a texture (wavy strata lines, speckles, pebbles) pre-rendered to an offscreen canvas per theme and clipped to the terrain shape each frame, with a soft shadow under the grass edge and small grass tufts along the surface.
- Four colour-only themes (Meadow, Desert, Snow, Night with twinkling stars) and a Valley map type (high ridges at both ends, deep dip in the middle), the theme is chosen by the player or, on Random, from a hash of the map seed and named in a small label on the field.
- Birds fly across the sky (none on Easy, one on Normal and 2-player, two on Hard) with flapping wings. A shell that touches a bird is wasted: the bird falls with feather particles and the turn passes on.
- Tank movement: hold on-screen left/right buttons or the A and D keys to drive up to 50 pixels per turn (1.5 px per step), blocked by slopes steeper than 3 px per step, holes (a spot more than 6 px below the ground 12 px away on both sides), the field edge and the other tank. The CPU on Normal and Hard moves 15-50 px on its own half before shooting.
- Random map button, Daily map button seeded from the date, best score and a daily streak (consecutive days the daily map was finished, with today's score) saved in localStorage inside try/catch.
- Also six extra weapons: Firework (bursts into ten coloured sparks at the apex), Popcorn (four small pops along the ground, then a final bang), Mole (lands, then burrows towards the enemy digging a trench and explodes on a tank or after about 80 steps), Snowball (rolls and grows, bigger blast the further it rolls), Black Hole (huge crater with a spinning vortex and particles pulled inward) and Boomerang (swings out past the standard arc and curves back to the same landing spot; the CPU never picks it). Laser Strike (a beam from orbit at the landing x: deep shaft, hits the enemy anywhere in that column), Quake (two shockwaves run 3 px a frame along the surface, cracking it, +50 to the first tank reached), Magnet (drags the enemy up to 44 px toward the impact, stopping at crater edges and steep slopes), Volcano (raises a mound and spits six lava blobs, 30 pts each) and Teleporter (no damage, moves your own tank to the landing spot if it can stand there; the CPU never picks it).
- Friendly fire: any weapon whose blast reaches the tank that fired it subtracts pts * (1 - distance / reach) (min 5, zero-point weapons count as 50) from the shooter, with a red floating label; scores may go negative.
- Per-weapon blast effects: fireball with rays and embers, concentric shockwave rings (white flash for the nuke), radial lightning with glowing discs, rainbow streaks with a bead ring, ice spikes, dust.
- Each weapon has its own drawn sprite while flying (rocket, round bomb with a fuse, spinning wheel, drill, flame drop, balloon on a string and so on) and a matching emoji icon on its button.
- A propeller plane flies across near the clouds now and then. A shell that hits it makes it fall in a spin with smoke and crash with a fireball; if it lands within 30 px of a tank the shooter gets +100 for the enemy tank or -100 for their own.
- A wild animal that fits the terrain (deer on Meadow, camel on Desert, polar bear on Snow, deer or bear at Night) walks in at a field edge, watches, then leaves. Blasts and shells kill it (tumble and fade); it returns after 15-30 seconds. No score effect.
- A terrain picker on the start menu (Random, Meadow, Desert, Snow, Night) and a weapons option: Random weapons, or a picker panel where the player chooses up to 10 of the 22 (the rest are filled at random, both tanks share the hand, a Dirt Ball always brings a Dirt Remover). The Daily map ignores both.
- Particles, expanding rings, screen shake, Web Audio synth sounds with a mute button, a start overlay and a results overlay.

Want to tighten it up first? Run this prompt through the AI Prompt Studio to score it across 8 quality dimensions, catch anti-patterns, and tune the wording for Claude, ChatGPT, or Gemini before you paste it in.