Drag the background!

Search JS code (of Worlds)

Search JavaScript code of all Worlds for: AB socket


Websockets boxes
802 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
237 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)
Wordle 3D v1
674 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) {
3D Snake
621 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){ //
Hunting Season
1389 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){
Translation
216 runs ♦ 0 likes
By Renso Guilalas  
Created: 18 Nov 2023
Modified: 5 Feb 2024
Websockets World where two users in different languages can talk to each other and system transl...
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.
Dragon Ball Meng...
932 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); }
Test Websockets
176 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>" );
Password Websock...
66 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
Chess
5850 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)
Websocket chat
885 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)
Mighty Spread
331 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);
Competitive Hangman
422 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
Cook A Long
269 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)
Space Odyssey
441 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
The San Andreas ...
1023 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); }
Password Websock...
38 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)
Websocket buttons
197 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)
Stack (Multiplayer)
536 runs ♦ 1 like
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 })
Lego
525 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 ({
escape...
800 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)
Run Run Run!
5690 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
435 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);
Battleship
4277 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)
Zombie Escape
4092 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)
Tic-Tac-Toe (clo...
3 runs ♦ 0 likes
By John Lasis  
Created: 5 Dec 2022
Modified: 17 Sep 2023
Clone of "Tic-Tac-Toe (clone by Scott Brady)" by Scott Brady
AB.socketStart(); // starts socket at game start
if (AB.socket) {
if (AB.socket.connected) {
// AB.socketOut("TESTING SOCKETS!!!");
AB.socketOut("startOver");
New World
44 runs ♦ 0 likes
By Jon Bryan Ortiz  
Created: 21 Nov 2022
Modified: 17 Sep 2023
AB.socketStart();
Fruit Fall
28 runs ♦ 0 likes
By Robert  
Created: 5 Dec 2022
Modified: 17 Sep 2023
AB.socketIn = function (score) {
if (AB.socket) {
if (AB.socket.connected) {
AB.socketOut(score_counter)
Websockets boxes...
0 runs ♦ 0 likes
By Genesis  
Created: 8 Jul 2023
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
Websockets boxes...
0 runs ♦ 0 likes
By Benjamin Olojo  
Created: 24 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
Mighty Spread (c...
0 runs ♦ 0 likes
By Tara  
Created: 15 Nov 2023
Modified: 15 Nov 2023
Clone of "Mighty Spread" by Gareth Hogan
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);
Minecraft
468 runs ♦ 2 likes
By David L  
Created: 24 Nov 2022
Modified: 17 Sep 2023
Testing
// AB.socketOut ( data ); // broadcast to existing clients
// // AB.socketUserlist = function ( array ) { ... };
// AB.socketIn = function ( data ) // data = array [ messagetype, payload ]
// // AB.socketUserlist = function ( array )
// AB.socketOut ( data );
Websocket chat (...
2 runs ♦ 0 likes
By Vaidas Buzas  
Created: 15 Nov 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 boxes...
1 run ♦ 0 likes
By Lorcan Dunne  
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
Websocket chat (...
0 runs ♦ 0 likes
By Cian sullivan  
Created: 14 Nov 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)
Adding Multiplay...
8 runs ♦ 0 likes
By Colin Ekedigwe  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Clone of "Adding Multiplayer functionality to Football World" by Kline
AB.socketStart();
if ( AB.socket.connected ) $("#out").html ( "<p style='color:green; font-weight:bold;'> Websocket server up </p>" );
Websockets boxes...
0 runs ♦ 0 likes
By Kline  
Created: 29 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
Button Count v2 ...
187 runs ♦ 0 likes
By Stephen Walsh  
Created: 19 Feb 2023
Modified: 17 Sep 2023
Clone of "Button Count (websocket test)" by Stephen Walsh
// AB.socketStart();
AB.socketStart ();
AB.socketStart ( password );
AB.socketOut (data);
AB.socketIn = function(data)
Websockets boxes...
0 runs ♦ 0 likes
By Jack  
Created: 27 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


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.