Multiple Ducks in the Pond

1,513 views
Skip to first unread message

Joshua Gitlin

unread,
Aug 17, 2014, 4:36:08 PM8/17/14
to blockl...@googlegroups.com
I've really enjoyed the PondJS Blocky Game, and wanted to share a little hack I devised. I wanted to test two of my duck programs against each other, so I devised a quick little Javascript Bookmarklet which lets you add an additional duck to the pond using user-supplied code. The Bookmarklet is:

javascript:$.Ba.push(new al(prompt('New Duck Name'), Y.qb.getValue(), new B(20+Math.random()*40,20+Math.random()*40), 0, $));

Load up PondJS level 10 and enter a duck program into the editor. Paste that bookmarklet into the address bar and you'll be prompted for a Duck Name. A new duck will be created using the code that's currently in the editor. Replace the code in the editor and repeat as many times as you like. When you start the game, the "Player" duck still uses the current code in the editor, and any ducks created using the bookmarklet keep the code as it was when you created them; so, paste in the editor the code for a duck, create it using the bookmarklet, and then change the code in the editor to a second piece of code, and run: you'll get two ducks using two separate pieces of code.

The code above was hacked up from the minified source for the current version and might break. I'd live to see this added as a real feature! The unminified code to add this should be something like:

Pond.Battle.addPlayer(prompt('New Duck Name'), BlocklyInterface.editor['getValue'](), new goog.math.Coordinate(20+Math.random()*40,20+Math.random()*40), 0, Pond));

Enjoy!

Neil Fraser

unread,
Aug 18, 2014, 5:30:28 PM8/18/14
to blockl...@googlegroups.com
On Sunday, 17 August 2014 13:36:08 UTC-7, Joshua Gitlin wrote:
The code above was hacked up from the minified source for the current version and might break. I'd live to see this added as a real feature! The unminified code to add this should be something like:

Pond.Battle.addPlayer(prompt('New Duck Name'), BlocklyInterface.editor['getValue'](), new goog.math.Coordinate(20+Math.random()*40,20+Math.random()*40), 0, Pond));

Enjoy!

Woo!  Nice hack.

The development plan for next week is to start development of a multi-user competitive Pond with a global database of stack-ranked ducks.  With the potential for millions of ducks, scalability and security were the tricky bits.  Fortunately both these problems have been solved.

BTW, if you like Pond, see CROBOTS.  Pond is directly based on this 1985 game (with the original author's permission).  There's a hidden page here that details the key differences:

Joshua Gitlin

unread,
Aug 19, 2014, 12:05:06 AM8/19/14
to blockl...@googlegroups.com

The development plan for next week is to start development of a multi-user competitive Pond with a global database of stack-ranked ducks.  With the potential for millions of ducks, scalability and security were the tricky bits.  Fortunately both these problems have been solved.

 That is AWESOME! I will be eagerly awaiting that. Really nice work on this. I thoroughly enjoy using Pond and am recommending it to all who I think might be interested.

Thaler Benedek

unread,
Mar 11, 2015, 4:43:58 PM3/11/15
to blockl...@googlegroups.com


On Monday, August 18, 2014 at 11:30:28 PM UTC+2, Neil Fraser wrote:

The development plan for next week is to start development of a multi-user competitive Pond with a global database of stack-ranked ducks.  With the potential for millions of ducks, scalability and security were the tricky bits.  Fortunately both these problems have been solved.


Hi,

What about this improvement? It would be great to have tournaments and face-to-face challenges. Building something like Joshua shared above is easier, but creating a real multiplayer experience (i.e: duck code running on the server, projected to the competitors browser) is a more complex challenge.

Thanks,
Benedek

Neil Fraser

unread,
Mar 12, 2015, 1:29:45 AM3/12/15
to Thaler Benedek, blockl...@googlegroups.com
Actively working on multi-user Pond. Progress has been very slow
since ongoing support for the core Blockly library is our primary
responsibility. Soon...
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Blockly Games" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/blockly-games/AZcVrtnVmLs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> blockly-game...@googlegroups.com.
> To post to this group, send email to blockl...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/blockly-games/c694695e-350f-4d16-85d5-4387b9bb7382%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Neil Fraser, Software Engineer
Google, Mountain View, California

Devin Vollmer

unread,
Jul 29, 2015, 9:28:52 PM7/29/15
to Blockly Games, joshg...@gmail.com
Thank you for sharing this Josh, but does this hack still work?  I just tried using it my pasting javascript:$.Ba.push(new al(prompt('New Duck Name'), Y.qb.getValue(), new B(20+Math.random()*40,20+Math.random()*40), 0, $)); Into the address bar of level 10 in pond and had no success.  I've also tried creating Bookmarklets using the same code, but opening these bookmarklets only opens a new blank page.

I could just be misunderstanding a step here, I'm not an expert.

Any recommendations would be appreciated,
Dev

TheBIGGESTCanimalsFan VGCP TPNG

unread,
Nov 15, 2015, 10:41:44 AM11/15/15
to Blockly Games
Are you sure it works? I tried to add a single duck, but it cannot work

jama...@ugcloud.ca

unread,
Apr 15, 2016, 12:10:53 PM4/15/16
to Blockly Games


On Sunday, August 17, 2014 at 4:36:08 PM UTC-4, Joshua Gitlin wrote:

jama...@ugcloud.ca

unread,
Apr 15, 2016, 12:11:08 PM4/15/16
to Blockly Games


On Sunday, August 17, 2014 at 4:36:08 PM UTC-4, Joshua Gitlin wrote:

Gyan S

unread,
Aug 22, 2017, 2:33:54 AM8/22/17
to Blockly Games, thaler...@gmail.com
Neil - How is your multi-user Pond project coming along? I am eagerly waiting for this.

We did few small hacks in the game to make it multi-player and organised a competition primarily for non-coder. It was a huge success.

Marcos Dias

unread,
Sep 1, 2018, 11:06:24 PM9/1/18
to Blockly Games

Litten the Fire Cat Pokemon

unread,
Aug 9, 2019, 1:51:27 AM8/9/19
to Blockly Games
Very neat! I wonder why it hasn't been touched in almost a year now? I'd love to see more!
Reply all
Reply to author
Forward
0 new messages