Drag the background!

Search JS code (of Worlds)

Search JavaScript code of all Worlds for: AB msg


Collision World
1462 runs ♦ 4 likes
By Starter user  
Created: 21 Sep 2017
Modified: 17 Sep 2023
Demo of Physics API. Blocks fall under gravity and collide. Can modify gravity, friction, etc. S...
// AB.msg ( "Box " + boxno + " position: <tt> " + AB.vector3toString ( currentbox.position ) + "</tt>" );
AB.msg ( "Box " + boxno + " height: <tt> " + Math.floor(currentbox.position.y) + "</tt>" );
Password Websock...
71 runs ♦ 0 likes
By Starter user  
Created: 14 Nov 2022
Modified: 17 Sep 2023
Password version of "Websockets boxes"
AB.msg ( ` <hr> <p> Multi-user game. Pick a side. Click buttons to change boxes on all users' machines. Drag the camera. <p>
Phaser test World
59 runs ♦ 1 like
By Mark Humphrys  
Created: 29 Apr 2023
Modified: 11 Sep 2024
Basic Phaser World. Player moved with left-right-up keys. Can jump. Physics.
AB.msg ("Move player with left-right and up keys.");
Touch World
472 runs ♦ 1 like
By Starter user  
Created: 6 Jan 2018
Modified: 17 Sep 2023
How to override default touch handling. Mobile: Touch drag moves agent, touch pinch zooms camera...
AB.msg ( " Step: " + AB.step +
if ( AB.onDesktop() ) AB.msg ( "<p> Desktop: Keyboard arrows to move agent. Mouse drag to move camera. Mouse scroll to zoom camera.
else AB.msg ( "<p> Mobile: Touch drag to move agent. Touch pinch to zoom camera. </p>" );
if ( AB.abortRun ) AB.msg ( " <br> <font color=red> <B> Agent trapped. You lose! </B> </font> ", 3 );
else AB.msg ( " <br> <font color=green> <B> Run over. </B> </font> ", 3 );
Run Run Run!
5734 runs ♦ 3 likes
By Duarte Martinho  
Created: 15 Nov 2022
Modified: 17 Sep 2023
CA318 Project by Duarte Martinho and Rion Xheladini. Modified port of "Crossy Road" by Hunor Mar...
AB.msg("<p>Current number of players = " + e.length + "\n</p>", 2); // Display number of players
AB.msg("<p>Time left: <strong>" + clock.currTime + "</strong> seconds</p>", 5); // Update time left screen
AB.msg("<p>Time left: <strong>" + clock.currTime + "</strong> seconds</p>", 5); // Update time
AB.msg(`<h3> Welcome to our game!</h3>`, 1);
AB.msg(`<p><strong>Player 1</strong> Score: <strong>` + score1 + `</strong> | Highest: <strong>` + hscore1 + `</strong> </p>`, 3);
Dragon Ball Meng...
945 runs ♦ 0 likes
By MENGTE ZHU  
Created: 14 Nov 2022
Modified: 22 Jan 2024
AB.msg ( ` <hr> <p> Multi-user game. Pick a character. Click buttons to change Dragon balls on all users' machines. Drag the camera.
Castle World
801 runs ♦ 4 likes
By Starter user  
Created: 11 Nov 2016
Modified: 17 Sep 2023
Demo of how to insert 3d model into World. Mind-controlled agent, actively-pursuing enemy. Splas...
AB.msg ( "Step: " + AB.step + " out of " + AB.maxSteps + ". Score: " + score );
Recognise any image
339 runs ♦ 0 likes
By Starter user  
Created: 10 Jun 2021
Modified: 17 Sep 2023
Try to recognise any image with ML5 and MobileNet. Enter any image URL at runtime.
// AB.msg ( "Running image recognition ... <br> ", 1 );
AB.msg ( "<font color=red> <B> Error recognising image. See console for details. </b></font> <br> ", 2 );
AB.msg ( r, 3 );
Landmark Museum
169 runs ♦ 0 likes
By Christopher Dobey  
Created: 4 Dec 2023
Modified: 29 Jul 2024
A walkthrough tour of the most significant landmarks in any given country. Three.js 3D World wit...
AB.msg(thehtml, 1);
P5 chase World
199 runs ♦ 0 likes
By Starter user  
Created: 4 Aug 2018
Modified: 17 Sep 2023
Example of World with Mind on P5 plain API. No AB framework. Have to call Mind yourself. Mind mo...
AB.msg ( " <p> The job of the Mind is to move the object closer to the target. </p> " );
AB.msg ( " <p> Step: " + AB.step + " Score: " + score + " </p> ", 2 );
CA318 2018 World
2161 runs ♦ 3 likes
By Mark Humphrys  
Created: 25 Sep 2018
Modified: 11 Sep 2024
CA318 practical 2018: Write a Mind to solve this World.
AB.msg ( status );
AB.msg ( status, 2 );
AB.msg ( " <br> <font color=red> <B> Agent blocked. " + BLOCKPUNISH + " extra bad steps and reset enemy. </B> </font> ", 3 );
AB.msg ( " <br> <font color=green> <B> Run over. </B> </font> ", 3 );
ML5 image recogn...
109 runs ♦ 0 likes
By Starter user  
Created: 10 Jun 2021
Modified: 17 Sep 2023
Demo of image recognition using ML5 and MobileNet. Image URL is hardcoded.
// AB.msg ( "Running image recognition ... <br> ", 1 );
AB.msg ( "<font color=red> <B> Error recognising image. See console for details. </b></font> <br> ", 2 );
AB.msg ( r, 3 );
Space Odyssey
447 runs ♦ 0 likes
By Yiming Fu  
Created: 2 Dec 2022
Modified: 17 Sep 2023
Clone of "Websockets boxes" by Starter user
AB.msg ( ` <hr> <p> This is a multi-user game.<br><br>Try dragging the camera to en-<br>joy the cosmic landscape.<br><br>Would you r
Simple World
1714 runs ♦ 2 likes
By Starter user  
Created: 1 Oct 2016
Modified: 17 Sep 2023
Simple World with a Mind-controlled agent, randomly-moving enemy, paint blocks with texture.
AB.msg ( " Step: " + AB.step + " out of " + AB.maxSteps + ". Score: " + score );
3. Making an Avatar
121 runs ♦ 0 likes
By "3D Game Program...  
Created: 16 Aug 2018
Modified: 17 Sep 2023
Port of code "building_an_avatar" from Ch.3
AB.msg ( " <p> Drag and zoom the camera (built-in). </p> " );
canvas 2d
359 runs ♦ 2 likes
By Starter user  
Created: 4 Oct 2017
Modified: 17 Sep 2023
Minimal starter World for "Canvas" API (no graphics library). Program using getContext("2d"). Pa...
AB.msg ( "Step: " + AB.step );
Zombie Death Baby
803 runs ♦ 1 like
By Starter user  
Created: 11 Jun 2018
Modified: 17 Sep 2023
How to make a fun touch game for mobile. Touch drag and tap objects. Mouse drag and click object...
AB.msg ( buttons, 3 );
AB.msg ( " Step: " + AB.step + " Score: <span style='" + scoreStyle + "'>" + score + "</span>" );
if ( AB.abortRun ) AB.msg ( " <br> <font color=red> <B> You are trapped. You lose! </B> </font> ", 2 );
else AB.msg ( " <br> <font color=green> <B> Run over. You survived! </B> </font> ", 2 );
GA (TSP)
1112 runs ♦ 0 likes
By "Coding Train" p...  
Created: 24 Jun 2019
Modified: 17 Sep 2023
Genetic Algorithm to solve the Traveling Salesman Problem.
AB.msg ( "Number of cities: " + (totalCities) +
AB.msg ( "<br> Number of routes looked at: <b> All possible routes </b> " +
AB.msg ( "<br> Number of routes looked at: " + routesLookedAt +
AB.msg ( "<p> Generation: " + gen +
Perceptron
950 runs ♦ 1 like
By "Coding Train" p...  
Created: 26 Jun 2019
Modified: 17 Sep 2023
Perceptron to separate points.
AB.msg ( "Line: y = " + a.toFixed(2) + " x + " + b.toFixed(2) +
AB.msg ( "<br> Training on single point: " + count, 2 );
AB.msg ( "<br> Drawing points 0 to " + (count-1), 3 );
Battleship
4283 runs ♦ 2 likes
By Aaron Crawford  
Created: 30 Oct 2022
Modified: 17 Sep 2023
AB.msg (
MineCraft
1141 runs ♦ 2 likes
By Starter user  
Created: 27 Nov 2016
Modified: 17 Sep 2023
Use keyboard to draw blocks like in MineCraft. Use arrow keys and PgUp, PgDn to draw. Can save w...
AB.msg ( " <button onclick='saveData();' class='ab-normbutton mybutton' >Save work</button> " );
AB.msg ( " <button onclick='restoreData();' class='ab-normbutton mybutton' >Restore work</button> ", 2 );
Websockets boxes
812 runs ♦ 0 likes
By Starter user  
Created: 29 Feb 2020
Modified: 17 Sep 2023
Demo of Websockets in 3D World. Click to change the boxes on the other user's machine, while the...
AB.msg ( ` <hr> <p> Multi-user game. Pick a side. Click buttons to change boxes on all users' machines. Drag the camera. <p>
Lion Chase
460 runs ♦ 0 likes
By Martin Derwin  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Don't get caught by the lions
if ( AB.abortRun && p1lose) AB.msg ( " <br> <font color=red> <B> Player 1 was caught! Player 2 wins. </B> </font> ", 2 );
else if ( AB.abortRun && p2lose) AB.msg ( " <br> <font color=red> <B> Player 2 was caught! Player 1 wins. </B> </font> ", 2 );
Final Pool
1177 runs ♦ 2 likes
By Ian Gilligan  
Created: 1 Mar 2019
Modified: 17 Sep 2023
Pool Predictor for CA326
AB.newSplash ("<p align=\"center\">Error!</p><p align=\"center\"> "+ msg +"</p>");
Complex World
8325 runs ♦ 5 likes
By Starter user  
Created: 1 Oct 2016
Modified: 17 Sep 2023
World with a Mind-controlled agent, actively-pursuing enemy, random maze, skybox, music.
AB.msg ( " Step: " + AB.step + " &nbsp; x = (" + x.toString() + ") &nbsp; a = (" + a + ") " );
AB.msg ( " &nbsp; y = (" + y.toString() + ") <br>" +
if ( AB.abortRun ) AB.msg ( " <br> <font color=red> <B> Agent trapped. Final score zero. </B> </font> ", 3 );
else AB.msg ( " <br> <font color=green> <B> Run over. </B> </font> ", 3 );
The San Andreas ...
1027 runs ♦ 0 likes
By Effa  
Created: 1 Dec 2022
Modified: 17 Sep 2023
AB.msg (
Lego
538 runs ♦ 0 likes
By Michael Walsh  
Created: 14 Nov 2022
Modified: 1 Oct 2023
Clone of "webgl_interactive_voxelpainter" by threejs.org porting project
AB.msg (`<ul style="padding-left: 2ch;">`
Zombie Escape
4107 runs ♦ 6 likes
By Liam  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Compete with another player to see who can survive the longes against a hoard of zombies!
AB.msg("<p align=\"center\"> <font color=red> <B> Your lives: " + lives + "<p align=\"center\"> <font color=blue> <B> Opponent's Liv
AB.msg("<p align=\"center\"> <font color=red> <B> Your lives: </B>" + lives + "<p align=\"center\"> <font color=blue> <B> Opponent'
Mighty Spread
340 runs ♦ 0 likes
By Gareth Hogan  
Created: 12 Nov 2022
Modified: 17 Sep 2023
CA318 Project
AB.msg(winner, 7) // shows the winner
Interstellar cubes
650 runs ♦ 3 likes
By Thomas Mc Cann  
Created: 16 Oct 2019
Modified: 17 Sep 2023
A journey into Interstellar space. Run and press F12 (in chrome) to view the console. Try left c...
AB.msg ( "<p>Press <strong>F12 to view console!!</strong></p><p>Then try clicking and check the console</p><p>Or cheat and press <st
AB.msg ("<p>Clicking reduces the number of cubes by 1. <strong>You can't remove the last special cube</strong>.</p><Pressing z w
AB.msg ("</p>Pressing z will cycle through <strong>8</strong> zoom levels. <strong></p><p>CURRENT ZOOM LEVEL: " + zoom + "</stro
Character recogn...
2016 runs ♦ 0 likes
By "Coding Train" p...  
Created: 5 Jul 2019
Modified: 17 Sep 2023
Neural network to do character recognition from image database and from handwriting in real-time.
//--- start of AB.msgs structure: ---------------------------------------------------------
// We output a serious of AB.msgs to put data at various places in the run header
AB.msg ( thehtml, 1 );
AB.msg ( thehtml, 3 );
AB.msg ( thehtml, 5 );
Expo World
218 runs ♦ 0 likes
By Mark Humphrys  
Created: 17 Oct 2018
Modified: 11 Sep 2024
Infinite changing demo for expos.
AB.msg ( status );
AB.msg ( status, 2 );
AB.msg ( " <br> <font color=red> <B> Agent blocked. " + BLOCKPUNISH + " extra bad steps and reset enemy. </B> </font> ", 3 );
AB.msg ( " <br> <font color=green> <B> Run over. </B> </font> ", 3 );
3D Snake
632 runs ♦ 1 like
By przemek biel  
Created: 29 Nov 2022
Modified: 17 Sep 2023
snake eats apple nom nom but in 3D
AB.msg("Hit the arrow keys to spawn snake!");
AB.msg("P1 Score = " + p1score + " P2 score = " + p2score + "\n Time remaining: " + Math.trunc(99 - gameClock.getElapsedTim
Chess
5865 runs ♦ 2 likes
By Eoin Daly  
Created: 19 Oct 2022
Modified: 17 Sep 2023
A game of chess by the beach, on a beautiful day
AB.msg ( ` <hr> <p> Chess game. Pick a side. Click buttons to pick colour. <p>
AB.msg ( ` <hr> <p> Chess game. Pick a side. Click buttons to pick colour. <p>
Model World
864 runs ♦ 2 likes
By Starter user  
Created: 8 Nov 2016
Modified: 17 Sep 2023
Demo of how to insert 3d models into World. Mind-controlled agent, actively-pursuing enemy. Skybox.
AB.msg ( " Step: " + AB.step + " out of " + AB.maxSteps + ". Score: " + score );
1. Shapes
182 runs ♦ 0 likes
By "3D Game Program...  
Created: 16 Aug 2018
Modified: 17 Sep 2023
Port of code "shapes" from Ch.1
AB.msg ( " <p> Drag and zoom the camera (built-in). </p> " );
Hunting Season
1399 runs ♦ 1 like
By Niall Kelly  
Created: 3 Nov 2022
Modified: 17 Sep 2023
The aim is simple, shoot as many targets as you can in 60 seconds. Watch out for the hawk's, the...
AB.msg("P1 Score = " + p1score + " P2 score = " + p2score + "\n Time remaining: " + Math.trunc(60 - gameClock.getElapsedTim
Binary tree
4209 runs ♦ 0 likes
By "Coding Train" p...  
Created: 25 Apr 2019
Modified: 17 Sep 2023
Binary tree search demo.
AB.msg( "console log shows how we search a sorted tree quickly <br> search tree for " + x + "<br>" );
if (result == null) AB.msg('not found', 2);
else AB.msg('found', 2);
clone by kanish ...
26 runs ♦ 0 likes
By kanish r  
Created: 13 Nov 2022
Modified: 17 Sep 2023
Clone of "Complex World" by Starter user
AB.msg ( " Step: " + AB.step + " &nbsp; x = (" + x.toString() + ") &nbsp; a = (" + a + ") " );
AB.msg ( " &nbsp; y = (" + y.toString() + ") <br>" +
if ( AB.abortRun ) AB.msg ( " <br> <font color=red> <B> Agent trapped. Final score zero. </B> </font> ", 3 );
else AB.msg ( " <br> <font color=green> <B> Run over. </B> </font> ", 3 );
Expo World (clon...
5 runs ♦ 0 likes
By Pengyang Yu  
Created: 12 Oct 2024
Modified: 12 Oct 2024
Clone of "Expo World" by Mark Humphrys
AB.msg ( status );
AB.msg ( status, 2 );
AB.msg ( " <br> <font color=red> <B> Agent blocked. " + BLOCKPUNISH + " extra bad steps and reset enemy. </B> </font> ", 3 );
AB.msg ( " <br> <font color=green> <B> Run over. </B> </font> ", 3 );


The background is a program, showing the JavaScript graphics used on this site.
The globes light up when you log in.
 
Font:

Users retain ownership of user content.

Platforms      Stats      The name      Terms and conditions

Call for partners      Contact

Call for partners!
Ancient Brain is looking for a partner to co-write a JavaScript coding book for schools, to be used worldwide. This would be a course for students in learning to code from scratch. The book and course will be integrated into the Ancient Brain site. This is an opportunity for someone looking to develop a course and textbook to partner with a site to promote it. Read more.