Modded Pond Tutor and Pond (Arena) game categories

475 views
Skip to first unread message

doudley

unread,
Oct 29, 2016, 7:20:42 AM10/29/16
to Blockly Games
I tried looking for a multiplayer alternative for the pond but can't find any, aside from the hack seen in one of the thread here but that doesn't work anymore. I made a couple of programs for the Pond category and I modified the Compressed JavaScript files inside the offline Blockly Games web source so that I could test my duck programs for myself. I had so much fun trying to beat my designs so I want it to share it here if anybody wants to test it for themselves.

I want to test duck programs done by others but can't find anything in the web. Hopefully someone else would upload their design too so that I could learn more and improve my ducks better! :)

Modified contents:
- Pond category (Players Rook and Counter have been replaced with my own players)
- Pond Tutor category (level 2, 4, 6, 8 and 10 are now changed for one-on-one battles; players Target, Pendulum and Scared have been replaced by my own players.)

Download attachment file for the modified Blockly Games. Extract folder then open "index.html" to play the game.
blockly-games(modbydoudley).zip
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

doudley

unread,
Nov 22, 2016, 3:16:53 PM11/22/16
to Blockly Games
23-Nov-2016

- Possibly my final update. Pond Tutor levels' improved. Modification only affects level 2, 4, 6, 8 and 10. Download the attachment file on this post.

9-Nov-2016

- Improved programs for all custom A.I. ducks. Also added a new duck code named Banshee, replacing Sniper in Pond Arena.

1-Nov-2016

- Code refurbishing - this will also stop Kshatriya getting stuck by the wall.

30-Oct-2016

- I made pond tutor's custom opponent, "Red Comet", to a more formidable combatant.


My personalized (A.I.) ducks' brief summary:

Shinanju - a sly opponent that hates taking it slow. Can be fought at Pond Tutor level 6 and Pond Arena.

Kshatriya - rampant assaults is its trademark but shies away in a short moment if got hurt. Can be fought at Pond Tutor level 4 and Pond Arena.

Banshee - takes precaution of its distance and ideal range, known for its unique radar --- like wings flapping. Can be fought at Pond Tutor level 8 and Pond Arena.

Phenex - brother of Banshee. Champion of one-on-one battles, highest chance to dominate every opponent. Can only be fought at Pond Tutor level 10.

Red Comet - the willful one. Never stops moving while being able to shoot in a 1 width aim. Can only be fought at Pond Tutor level 2.
blockly-games(modbydoudley).zip

Julien de Vulpillières

unread,
Dec 7, 2016, 10:46:17 AM12/7/16
to Blockly Games
Hi Doudley,

Thanks for your post.
How can I use your modified Blockly Games to try my own ducks? Where can I insert my java script?
I give you the links to see my tries (they are quite simple anyway):

Maybe you can improve yours.

Greetings,

Julien

doudley

unread,
Dec 7, 2016, 1:55:17 PM12/7/16
to Blockly Games
Hello Julien! Thank you for the reply.

I'm not sure if you will be pleased because I don't have an easy way for letting others, input their own script in my mod.

What I can do for you, is a guide on how I inserted my scripts in the game.


First, you will need a text program that can replace "Extended Regular Expressions" like "\n". I'm using Notepad++.

Now, go to blockly-games\en\pond\tutor\generated\en folder, you will see a compressed.js file there.

Open the file with your text editor and search for <div id="editor">, along this line you will find a <div id="playerTarget" style="display: none">. This is the starting TAG of the A.I. duck's code, inside this "div" tag is the code where you can replace and insert your own JavaScript A.I. program.

In this example, the red colored text here is the variable name of the A.I. duck's code. You can add your own codes if you like but it's easy to just replace the contents of the codes.

As you can see right now, the codes were compressed into a single line and it was converted into a STRING format.

You can easily convert your A.I. code into this by opening a new text file with your text program then paste your JavaScript code in there.

Then open Replace Dialogue Box (ctrl + H in Windows OS) and enter [\r\n]+ in the "find what" field, next is \\n in the "replace what" field. Then hit "replace all".

Now, you have a STRING version of your A.I. code. Copy your work and go back to compressed.js and replace the existing code inside  <div id="playerTarget" style="display: none"> and </div>.

Be sure that your code is closed by </div>.

At this moment, you can already save your edits and open BLOCKLY GAMES or refresh the web page of the game to test if you have succeeded.


But if you like to add your own CODE NAME for your A.I. code, simply insert yours beside the existing ones then go to the bottom most part of compressed.js

[{start:new w(50,30),na:0,name:"Pond_playerName",code:null},{start:new w(50,70),na:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new w(70,50),na:0,name:"Pond_playerName",code:null},{start:new w(20,50),na:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new w(20,20),na:0,name:"Pond_playerName",code:null},{start:new w(62.4264,62.4264),na:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new w(50,80),na:0,name:"Pond_playerName",code:null},{start:new w(50,20),na:0,
name:"Pond_targetName",code:"playerTarget"}],[{start:new w(90,50),na:0,name:"Pond_playerName",code:null},{start:new w(50,50),na:0,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new w(10,50),na:0,name:"Pond_playerName",code:null},{start:new w(50,50),na:0,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new w(20,80),na:0,name:"Pond_playerName",code:null},{start:new w(80,20),na:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new w(50,90),na:0,name:"Pond_playerName",code:null},
{start:new w(50,10),na:99,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new w(5,50),na:99,name:"Pond_playerName",code:null},{start:new w(95,50),na:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new w(10,10),na:50,name:"Pond_playerName",code:null},{start:new w(40,40),na:0,name:"Pond_scaredName",code:"playerScared"}]

Take notice of the word "start" on each group of event. Every "start" you see here is the equivalent number of levels the POND TUTOR game mode has and it is in sequence (from level 1 to level 10).

Red marked texts are the CODE NAMEs, same with our example earlier. The green marked texts are the DISPLAY NAMEs of the A.I. codes. The orange ones are the Health Handicap of that opponent for each level. na:99 means the opponent only has 1 point of health when the level starts and na:0 means it has full health.

If you want to add your own DISPLAY NAME, you have to go and search for <span id="Pond_targetName">Target</span>

 and add your own set of SPAN tag.


Okay that's it! Hope you understood and followed my instructions. Let me know if you have succeeded with your own modified Blockly Games. :)
Reply all
Reply to author
Forward
0 new messages