Skip to content
KBHXgamesAll games

Play Block Code Duck Pond Online

Code a rubber duck to aim, scan and swim, beating each rival in blocks first and then in typed JavaScript.

Block Code Duck Pond gameplay screenshot
  • Phones: some features

Tip: rotate your phone to landscape for a larger screen.

Block Code Duck Pond at a glance

Genre
Puzzle Games
Play with
Keyboard, Mouse, Touch screen
On phones
Partly
Players
1 player
Price
Free, no sign-up
License
Apache-2.0

Block Code Duck Pond turns a pond battle into a coding lesson. Your orange rubber duck has a cannon, a scanner and a pair of webbed feet, but it only acts on the program you give it. Every rival duck is a new problem to solve. Since each problem shows up once in blocks and once in JavaScript, you get to see how visual code turns into real text code.

The Goal

Bring the rival duck’s health to zero. Health bars under the pond show how much each duck has left, yours included. The pond is 100 by 100 meters, and angles go counterclockwise from east.

How a Round Plays Out

There are ten levels, built as five pairs. In the first level of a pair, you drag blocks such as cannon, scan and swim into a stack. In the second, you type the same idea into a code editor with line numbers and colors.

Press Run Program and the battle plays out live. Win, and a message shows the JavaScript your program matches. Then OK takes you on. The five challenges are:

  1. Hit a target that sits still with one aimed shot.
  2. Keep firing inside a while loop at a duck that can take many hits.
  3. Track a duck that moves back and forth by using scan.
  4. Swim toward a rival that is out of cannon range.
  5. Swim partway, stop and shoot when your own duck is weak, then chase a duck that runs away when hit.

Keys and Buttons for Block Code Duck Pond

Keyboard, mouse and touch controls for Block Code Duck Pond
What you do⌨ Keyboard🖱 Mouse👆 Touch
Build a program (block levels)—Drag blocks from the Pond and Math categoriesDrag blocks with your finger
Write a program (JavaScript levels)Type in the code editorClick in the editor to place the cursor—
Set an angle or a numberType the number and press EnterClick the value and type a new oneTap the value
Run or reset the battle—Click Run Program, then ResetTap Run Program, then Reset
Look up the commands—Click DocumentationTap Documentation

Winning Strategies

  • Sketch the angle. Before you aim, figure out roughly which way the rival is from your duck.
  • Let scan set the range. Writing cannon(angle, scan(angle)) makes the shot land wherever the rival really is.
  • Loop forever. A while (true) loop keeps the attack going until the rival goes down.
  • Stop before you collide. Ramming another duck hurts you as well, so slow down near the target.
  • Use the extra values. loc_x, loc_y, speed and health in the Documentation panel help with the harder battles.

Common Mistakes

  • Typing degrees clockwise, so the shot heads the wrong way.
  • Firing once without a loop and wondering why the rival survives.
  • Swimming nonstop into the rival on the weak-duck level.

Who Should Play It

This is a good match for students and curious beginners who know a bit about blocks and want a bridge to typed code. It also suits fans of robot-programming puzzles and turn-based artillery games.

Played and checked by the KBHX Games team · updated

Block Code Duck Pond: Questions and Answers

Is Block Code Duck Pond free?

Yes. All ten levels play in your browser at no cost, with no sign-up or download. It is a renamed version of a Google teaching game, and the levels themselves were left as they were.

Which direction is 0 degrees?

Zero points right, toward the east. From there, 90 points up, 180 points left and 270 points down. Open the Documentation panel any time to see a compass and a list of all the commands.

Why does my shot fall short?

The cannon only reaches 70 meters, while the pond is 100 meters across. If the rival is farther than that, swim closer first. Passing scan's result as the range also keeps your shots on target.

Can I finish it on a tablet?

The block levels work fine with touch. The JavaScript levels need typing, so a physical keyboard or a computer makes the second level of each pair much easier.

If You Liked Block Code Duck Pond, Try These