Drag the background!

Search JS code (of Worlds)

Search JavaScript code of all Worlds for: AB socket


Websocket buttons
206 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)
Lion Chase
460 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);
Find Woody's Hat
594 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
escape...
804 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)
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
Object.defineProperty(AB, "socket", {
Object.defineProperty(AB, "socket", { value: v });
AB.socketOut ({
AB.socketOut ({
AB.socketOut ({
Competitive Hangman
428 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
Websocket chat
990 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)
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.socketStart();
if(AB.socket){
if(AB.socket.connected){
AB.socketOut(p1score);
if(AB.socket){
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.socketStart();
if ( AB.socket )
if (AB.socket.connected)
AB.socketOut (data); // Sends the data to the other clients.
AB.socketUserlist = function(userList)
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.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
Cook A Long
280 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)
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!
if (AB.socket) {
if (AB.socket.connected) {
if(AB.socket)
if(AB.socket.connected)
AB.socketOut(lives)
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)
Translation
260 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.
Battleship
4283 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)
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)
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){ //
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);
Test Websockets
270 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>" );
The San Andreas ...
1027 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); }
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); }
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.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
Password Websock...
71 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
Stack (Multiplayer)
551 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 })
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.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) {
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) {
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)
Websocket button...
1 run ♦ 0 likes
By Cian sullivan  
Created: 30 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)
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
University Bird ...
280 runs ♦ 0 likes
By Colm McCarthy  
Created: 5 Dec 2022
Modified: 17 Sep 2023
Clone of "University Bird" by Niall Cian Quigley
AB.socketStart();
AB.socketOut(player1.score);
AB.socketOut(player1.isAlive);
AB.socketOut("flap");
AB.socketOut("flap");
3D Shooter
984 runs ♦ 1 like
By Senan Warnock  
Created: 20 Sep 2022
Modified: 17 Sep 2023
by Senan
AB.socketOut('left');
AB.socketOut('left2');
AB.socketOut('up');
AB.socketOut('up2');
AB.socketOut('right');
snake game
30 runs ♦ 0 likes
By przemek biel  
Created: 29 Nov 2022
Modified: 17 Sep 2023
Clone of "Simple World" by Starter user
AB.socketOut(e);
AB.socketStart();
AB.socketIn = function ( data ){
AB.socketUserlist = function ( array ){
3D Shooter (clon...
60 runs ♦ 0 likes
By Zak Smith  
Created: 5 Dec 2022
Modified: 17 Sep 2023
Clone of "3D Shooter" by Senan Warnock
AB.socketOut('left');
AB.socketOut('left2');
AB.socketOut('up');
AB.socketOut('up2');
AB.socketOut('right');
Paint By Blocks ...
0 runs ♦ 0 likes
By Zoey2  
Created: 25 Sep 2024
Modified: 25 Sep 2024
Clone of "Paint By Blocks v2 (Three.js) (clone by Vanya Cadogan)" by Vanya Cadogan
//AB.socketStart();
A1_Draft
970 runs ♦ 2 likes
By David Ghiurcan  
Created: 19 Nov 2022
Modified: 17 Sep 2023
A1
AB.socketStart();
if ( event.keyCode == 32 ) {explodeAsteroids(); fireMissile(); AB.socketOut();}
AB.socketIn = function() // incoming data on socket, i.e. clicks of other player
Websocket chat (...
3 runs ♦ 0 likes
By Yiming Fu  
Created: 30 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...
10 runs ♦ 0 likes
By Liam  
Created: 14 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
Websockets boxes...
2 runs ♦ 0 likes
By Dylan Corbari  
Created: 10 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
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
Run Run Run! (cl...
0 runs ♦ 0 likes
By Genesis  
Created: 23 Jan 2023
Modified: 17 Sep 2023
Clone of "Run Run Run!" by Duarte Martinho
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) {


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.