Drag the background!

Search JS code (of Worlds)

Search JavaScript code of all Worlds for: AB socket


Space Odyssey
449 runs ♦ 0 likes
By Yiming Fu  
Created: 2 Dec 2022
Modified: 17 Sep 2023
Clone of "Websockets boxes" by Starter user
AB.socketStart();
function pink() { changeBox(1); AB.socketOut (1); }
function blue() { changeBox(2); AB.socketOut (2); }
AB.socketIn = function(n) // incoming data on socket, i.e. clicks of other player
Cook A Long
281 runs ♦ 1 like
By Joseph Adeosun  
Created: 3 Dec 2022
Modified: 17 Sep 2023
Attempted port of "Chicken Alfredo Cooking Game" by Emily Cerequas and Jenny Kowalski. https://q...
AB.socketStart();
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
// --- re-define AB socket handler functions -------------------------------------
// When someone else enters text, server will trigger AB.socketIn.
AB.socketIn = function(data)
Wordle 3D v1
682 runs ♦ 2 likes
By Jed Hazaymeh  
Created: 1 Dec 2022
Modified: 17 Sep 2023
3D remake of the popular word puzzle game!
AB.socketOut({
AB.socketStart();
AB.socketIn = function ({ id, payload }) {
AB.socketUserlist = function (users) {
Hunting Season
1401 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.socketStart();
if(AB.socket){
if(AB.socket.connected){
AB.socketOut(p1score);
if(AB.socket){
Test Websockets
278 runs ♦ 0 likes
By Starter user  
Created: 14 Nov 2022
Modified: 17 Sep 2023
Test if Websocket server is up
AB.socketStart();
if ( AB.socket.connected ) $("#out").html ( "<p style='color:green; font-weight:bold;'> Websocket server up </p>" );
Run Run Run!
5735 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.socketStart(); // Calls the socket start function
AB.socketOut({
AB.socketUserlist = function (e) { // Function to handle socket user list
host = AB.socket.id; // Sets the host to the socket id
AB.socketIn = function (element) {
Lion Chase
464 runs ♦ 0 likes
By Martin Derwin  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Don't get caught by the lions
AB.socketStart(); // start sockets
AB.socketIn = function(data) // incoming data on socket, i.e. key movements of other players
AB.socketOut(data);
Websocket buttons
209 runs ♦ 0 likes
By Starter user  
Created: 29 Feb 2020
Modified: 17 Sep 2023
Demo of Ancient Brain Websockets functionality. Run on multiple devices. Simple page uses button...
AB.socketStart();
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
AB.socketIn = function(data)
escape...
807 runs ♦ 2 likes
By Jon Bryan Ortiz  
Created: 22 Nov 2022
Modified: 17 Sep 2023
There are 10 pages scattered around the map. First person to find all 10 pages escapes...the res...
AB.socketUserlist = function (a)
AB.socketStart();
AB.socketIn = function(score)
if (AB.socket)
if (AB.socket.connected)
Competitive Hangman
429 runs ♦ 2 likes
By David Jusev  
Created: 5 Dec 2022
Modified: 17 Sep 2023
Play hangman against friends. Multi-user port of https://codingartistweb.com/2022/05/hangman-gam...
AB.socketStart();
AB.socketOut ( data );
AB.socketIn = function(data)
AB.socketUserlist = function ( a )
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
Password Websock...
73 runs ♦ 0 likes
By Starter user  
Created: 14 Nov 2022
Modified: 17 Sep 2023
Password version of "Websockets boxes"
AB.socketStart ( password );
function baby() { changeBox(5); AB.socketOut (5); }
function skull() { changeBox(6); AB.socketOut (6); }
AB.socketIn = function(n) // incoming data on socket, i.e. clicks of other player
Password Websock...
40 runs ♦ 0 likes
By Starter user  
Created: 14 Nov 2022
Modified: 17 Sep 2023
Password only Websocket world (web page version). Need to enter password. Only join with users w...
AB.socketStart ( password );
AB.socketUserlist = function ( a ) // when told users I am sharing with
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World with this password
AB.socketIn = function(data)
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.socketStart();
if(AB.socket){ //if the socket is open
if(AB.socket.connected){ //and if the socket is connected
AB.socketOut(p1score); //send the score to the server
AB.socketIn = function (s){ //
Chess
5868 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.socketStart();
if ( AB.socket )
if (AB.socket.connected)
AB.socketOut (data); // Sends the data to the other clients.
AB.socketUserlist = function(userList)
Zombie Escape
4110 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!
if (AB.socket) {
if (AB.socket.connected) {
if(AB.socket)
if(AB.socket.connected)
AB.socketOut(lives)
The San Andreas ...
1028 runs ♦ 0 likes
By Effa  
Created: 1 Dec 2022
Modified: 17 Sep 2023
AB.socketStart ( password );
function cj() { changeBox(2); AB.socketOut (2); }
function bigsmoke() { changeBox(3); AB.socketOut (3); }
function ryder() { changeBox(4); AB.socketOut (4); }
function sweet() { changeBox(5); AB.socketOut (5); }
Websockets boxes
817 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.socketStart();
function baby() { changeBox(5); AB.socketOut (5); }
function skull() { changeBox(6); AB.socketOut (6); }
AB.socketIn = function(n) // incoming data on socket, i.e. clicks of other player
3D Platform Game
243 runs ♦ 0 likes
By Ronghui  
Created: 5 Dec 2022
Modified: 17 Sep 2023
Race to the End! WASD to move.
AB.newSplash() // sends out time to socketout and calls the game to be over
AB.socketOut({
AB.socket.destroy();
AB.socketStart();
AB.socketIn = function(element)
Dragon Ball Meng...
945 runs ♦ 0 likes
By MENGTE ZHU  
Created: 14 Nov 2022
Modified: 22 Jan 2024
AB.socketStart();
function Goku() { changeBall(7); AB.socketOut (7); }
function Vegeta() { changeBall(8); AB.socketOut (8); }
function Gohan() { changeBall(9); AB.socketOut (9); }
function Piccolo() { changeBall(10); AB.socketOut (10); }
Lego
539 runs ♦ 0 likes
By Michael Walsh  
Created: 14 Nov 2022
Modified: 1 Oct 2023
Clone of "webgl_interactive_voxelpainter" by threejs.org porting project
Object.defineProperty(AB, "socket", {
Object.defineProperty(AB, "socket", { value: v });
AB.socketOut ({
AB.socketOut ({
AB.socketOut ({
Stack (Multiplayer)
553 runs ♦ 2 likes
By Alexandru  
Created: 6 Dec 2022
Modified: 17 Sep 2023
window.onbeforeunload = function () {AB.socket.destroy();}
AB.socketStart();
AB.socketOut({ event: "restart" });
AB.socketOut({ event: "gameFinished", score: getScore(), username: AB.myuserid });
AB.socketOut({ event: "restart", username: AB.myuserid })
Mighty Spread
340 runs ♦ 0 likes
By Gareth Hogan  
Created: 12 Nov 2022
Modified: 17 Sep 2023
CA318 Project
AB.socketOut("Start"); // send out start command to all worlds so they remove the splash
AB.socketStart(); // start sockets
AB.socketIn = function(data) // incoming data on socket, i.e. clicks of other player
AB.socketOut(data);
Battleship
4288 runs ♦ 2 likes
By Aaron Crawford  
Created: 30 Oct 2022
Modified: 17 Sep 2023
AB.socketStart(); // Starts web sockets
if(AB.socket) // If the socket has loaded & connected
if(AB.socket.connected)
AB.socketOut(data); // Sends players boats positioning, current players score & turn
if(AB.socket)
Find Woody's Hat
600 runs ♦ 1 like
By Benjamin Olojo  
Created: 4 Dec 2022
Modified: 11 Sep 2024
Clone of "Capture the Hat" by Tuomas Bazzan
// use AB library for WebSocket Communication
AB.socketOut(hats); // send update for number of hats caught to the other user's world
AB.socketUserlist = function ( array ){
AB.socketIn = function ( data ){
AB.socketOut("captured"); // the user running the game has been captured, alert other user
Websocket chat
998 runs ♦ 0 likes
By Starter user  
Created: 29 Feb 2020
Modified: 17 Sep 2023
Demo of Ancient Brain Websockets functionality. Run on multiple devices. Chat from one to the other.
AB.socketStart();
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
// --- re-define AB socket handler functions -------------------------------------
// When someone else enters text, server will trigger AB.socketIn.
AB.socketIn = function(data)
A1_Draft (clone ...
18 runs ♦ 0 likes
By David Ghiurcan  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Clone of "A1_Draft" by Dave
AB.socketStart();
function baby() { changeBox(5); AB.socketOut (5); }
function skull() { changeBox(6); AB.socketOut (6); }
AB.socketIn = function(n) // incoming data on socket, i.e. clicks of other player
Test Websockets ...
0 runs ♦ 0 likes
By Kline  
Created: 29 Nov 2022
Modified: 17 Sep 2023
Clone of "Test Websockets" by Starter user
AB.socketStart();
if ( AB.socket.connected ) $("#out").html ( "<p style='color:green; font-weight:bold;'> Websocket server up </p>" );
AFinal
74 runs ♦ 0 likes
By David Ghiurcan  
Created: 6 Dec 2022
Modified: 17 Sep 2023
Clone of "Final_Version (clone by Sergiu)" by Sergiu
AB.socketStart();
if ( event.keyCode == 32 ) { fireMissile(); AB.socketOut(explodeAsteroids());} //if we press spacebar on keyboard we blow up the a
AB.socketIn = function(closestasteroid2ship) // incoming data on socket, i.e. clicks of other player
Websockets boxes...
2 runs ♦ 0 likes
By Aleksandrs Jegorovs  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Clone of "Websockets boxes" by Starter user
AB.socketStart();
function baby() { changeBox(5); AB.socketOut (5); }
function skull() { changeBox(6); AB.socketOut (6); }
AB.socketIn = function(n) // incoming data on socket, i.e. clicks of other player
Online Tower Bui...
6 runs ♦ 0 likes
By John Lasis  
Created: 5 Dec 2022
Modified: 17 Sep 2023
Clone of "Online Tower Builder" by Joseph Adedayo
AB.socketStart();
AB.socketIn = function(data) // takes in oppenent score and builds opponent tower next to user
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
AB.socketUserlist = function ( a ) // get information of users available
Websocket chat (...
0 runs ♦ 0 likes
By trherdtg  
Created: 9 Mar 2024
Modified: 9 Mar 2024
Clone of "Websocket chat" by Starter user
AB.socketStart();
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
// --- re-define AB socket handler functions -------------------------------------
// When someone else enters text, server will trigger AB.socketIn.
AB.socketIn = function(data)
Websocket chat (...
4 runs ♦ 0 likes
By Fionn Gallahar Hall  
Created: 5 Dec 2022
Modified: 17 Sep 2023
Clone of "Websocket chat" by Starter user
AB.socketStart();
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
// --- re-define AB socket handler functions -------------------------------------
// When someone else enters text, server will trigger AB.socketIn.
AB.socketIn = function(data)
Websockets Proje...
7 runs ♦ 0 likes
By junhao zhao  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Clone of "Websockets Project (clone by Jack)" by Jack
AB.socketStart(event)
AB.socketStart();
if ( AB.socket )
if ( AB.socket.connected )
AB.socketOut ( data );
Websocket button...
0 runs ♦ 0 likes
By Przemyslaw Majda  
Created: 15 Nov 2022
Modified: 17 Sep 2023
Clone of "Websocket buttons" by Starter user
AB.socketStart();
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
AB.socketIn = function(data)
Translation (clo...
0 runs ♦ 0 likes
By Jack Decker  
Created: 25 Nov 2024
Modified: 25 Nov 2024
Clone of "Translation" by Renso Guilalas
AB.socketStart ( password );
AB.socketUserlist = function ( a ) // when told users I am sharing with
AB.socketOut(messageData); // server gets this, and sends the data to all clients running this World
// --- re-define AB socket handler functions -------------------------------------
// When someone else enters text, server will trigger AB.socketIn.
Websocket chat (...
3 runs ♦ 0 likes
By testiny  
Created: 20 May 2023
Modified: 17 Sep 2023
Clone of "Websocket chat" by Starter user
AB.socketStart();
AB.socketOut ( data ); // server gets this, and sends the data to all clients running this World
// --- re-define AB socket handler functions -------------------------------------
// When someone else enters text, server will trigger AB.socketIn.
AB.socketIn = function(data)
Websockets boxes...
1 run ♦ 0 likes
By Martin Derwin  
Created: 30 Oct 2022
Modified: 17 Sep 2023
Clone of "Websockets boxes" by Starter user
AB.socketStart();
function baby() { changeBox(5); AB.socketOut (5); }
function skull() { changeBox(6); AB.socketOut (6); }
AB.socketIn = function(n) // incoming data on socket, i.e. clicks of other player
Chess (clone by ...
3 runs ♦ 0 likes
By przemek biel  
Created: 2 Dec 2022
Modified: 17 Sep 2023
Clone of "Chess" by Eoin Daly
AB.socket && AB.socket.connected && (data = {
}, AB.socketOut(data)), commands()
}, AB.socketStart();
AB.socketUserlist = function(e) {
}, AB.socketIn = function(e) {
Stacker Builder
271 runs ♦ 0 likes
By Thomas Moriarty  
Created: 29 Nov 2022
Modified: 17 Sep 2023
AB.socketOut ( data ); // broadcast to existing clients
AB.socketUserlist = function ( data ) // data = array [ messagetype, payload ]
AB.socketOut ( data );


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.