Drag the background!

Search JS code (of Worlds)

Search JavaScript code of all Worlds for: keycode


DALL-E Speech Ga...
304 runs ♦ 0 likes
By spandana  
Created: 23 Nov 2023
Modified: 11 Sep 2024
Text to image to caption to audio, with DALL-E and Azure. (1) User enters prompt. Calls DALL-E ...
if (event.keyCode == 13){
Language Transla...
143 runs ♦ 0 likes
By Darius Beril  
Created: 7 Dec 2023
Modified: 8 Feb 2024
AI Language Translator And Reader. (1) Uses OpenAI GPT API for translation. Need to enter your o...
document.getElementById('me').onkeydown = function(event) { if (event.keyCode == 13) sendchat(); };
The San Andreas ...
1027 runs ♦ 0 likes
By Effa  
Created: 1 Dec 2022
Modified: 17 Sep 2023
const me = document.getElementById('me').onkeydown = function(event) { if (event.keyCode == 13) sendchat(); };
function ourKeys ( event ) { return ( KEYS.includes ( event.keyCode ) ); }
if ( event.keyCode == KEY_UP ) // move a bit along angle we are facing
if ( event.keyCode == KEY_LEFT ) // rotate in place
if ( event.keyCode == KEY_RIGHT )
Catch the flag
4357 runs ♦ 2 likes
By Meabh Horan  
Created: 16 Nov 2016
Modified: 17 Sep 2023
if (e.keyCode == 37) moveLogicalAgent ( ACTION_LEFT );
if (e.keyCode == 38) moveLogicalAgent ( ACTION_DOWN );
if (e.keyCode == 39) moveLogicalAgent ( ACTION_RIGHT );
if (e.keyCode == 40) moveLogicalAgent ( ACTION_UP );
if (e.keyCode == 32) moveLogicalAgent ( ACTION_JUMPFORWARD); //cheat code to jump
Design Your Own ...
4420 runs ♦ 0 likes
By Jack O'Connor  
Created: 18 Feb 2019
Modified: 17 Sep 2023
Design Your Own Room Escape Game
if (keyCode === LEFT_ARROW)
else if (keyCode === RIGHT_ARROW)
if (keyCode === DOWN_ARROW && deg == 360)
Enhanced Space Pong
1018 runs ♦ 0 likes
By Enhanced  
Created: 18 Jun 2018
Modified: 17 Sep 2023
It's all you want from Pong : smooth controls, different difficulty levels and game modes
if (e.keyCode == 37) player.movement = -1;
if (e.keyCode == 39) player.movement = 1;
if (e.keyCode == 37 && player.movement == -1) player.movement = 0;
else if (e.keyCode == 39 && player.movement == 1) player.movement = 0;
Bomberman
303 runs ♦ 0 likes
By Enhanced  
Created: 21 Jun 2018
Modified: 17 Sep 2023
Classic game of Bomberman, try to kill the ennemy with a bomb !
if (e.keyCode == 32)
if (e.keyCode == 37)
if (e.keyCode == 38)
if (e.keyCode == 39)
if (e.keyCode == 40)
Infinite story book
454 runs ♦ 0 likes
By Darragh McG  
Created: 29 Nov 2023
Modified: 11 Sep 2024
Indefinite story book generation. Allows the user to automatically generate an illustrated short...
if (event.keyCode === 13 && !promptSubmitBtn.disabled) {
var code = e.which || e.keyCode;
if (event.keyCode === 13) {
Mighty Spread
340 runs ♦ 0 likes
By Gareth Hogan  
Created: 12 Nov 2022
Modified: 17 Sep 2023
CA318 Project
return(OURKEYS.includes(event.keyCode));
if(event.keyCode == 65) socketSender(ACTION_LEFT, 1);
if(event.keyCode == 87) socketSender(ACTION_DOWN, 1);
if(event.keyCode == 68) socketSender(ACTION_RIGHT, 1);
if(event.keyCode == 83) socketSender(ACTION_UP, 1);
Romantic Sunset
230 runs ♦ 0 likes
By Enhanced  
Created: 17 Aug 2018
Modified: 17 Sep 2023
Turn your head and discover a eautiful scenery observable in first person mode.
switch ( event.keyCode ) {
switch( event.keyCode ) {
Looney Tunes Cha...
1439 runs ♦ 2 likes
By Sean Sinnott  
Created: 16 Nov 2016
Modified: 17 Sep 2023
if (e.keyCode == 37)
if (e.keyCode == 38)
if (e.keyCode == 39)
if (e.keyCode == 40)
if (e.keyCode == 83)
Final Pool
1181 runs ♦ 2 likes
By Ian Gilligan  
Created: 1 Mar 2019
Modified: 17 Sep 2023
Pool Predictor for CA326
function ourKeys(event) {return(OURKEYS.includes(event.keyCode));}
if ( event.keyCode == 49 ) {selectBall(0);}
else if ( event.keyCode == 50 ) {selectBall(1);}
else if ( event.keyCode == 51 ) {selectBall(2);}
else if ( event.keyCode == 52 ) {selectBall(3);}
Game of Crowns
2360 runs ♦ 2 likes
By Niamh Byrne  
Created: 16 Nov 2016
Modified: 17 Sep 2023
var code = a.keyCode;
if (e.keyCode == 37) { moveLogicalAgent ( ACTION_LEFT ); e.preventDefault(); }
if (e.keyCode == 38) { moveLogicalAgent ( ACTION_DOWN ); e.preventDefault(); }
if (e.keyCode == 39) { moveLogicalAgent ( ACTION_RIGHT ); e.preventDefault(); }
if (e.keyCode == 40) { moveLogicalAgent ( ACTION_UP ); e.preventDefault(); }
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...
document.getElementById('me').onkeydown = function(event) { if (event.keyCode == 13) sendchat(); };
FLESHMAN PLAYS G...
4610 runs ♦ 2 likes
By Sean Hutchinson  
Created: 21 Oct 2016
Modified: 17 Sep 2023
if (e.keyCode == 37) // left
if (e.keyCode == 39) // right
if (e.keyCode == 38) // down
if (e.keyCode == 40) // up
if (e.keyCode == 97) // numpad1 is putt
First Person Con...
218 runs ♦ 0 likes
By Enhanced  
Created: 21 Jun 2018
Modified: 17 Sep 2023
First person view with mouse controls. Use WASD or Arrows to move, mouse to look around and spac...
switch ( event.keyCode ) {
switch( event.keyCode ) {
Text to 3D Graph...
211 runs ♦ 0 likes
By Antoine Podvin  
Created: 2 Dec 2023
Modified: 4 Feb 2024
Create 3D Graphics scenes from text instructions. Uses text instructions to call OpenAI GPT API ...
document.getElementById('me').onkeydown = function(event) { if (event.keyCode == 13) sendchat(); };
Gatekeeper
396 runs ♦ 0 likes
By Sam Murphy  
Created: 23 Nov 2023
Modified: 4 Feb 2024
A mysterious wizard is guarding a locked gate. Three.js 3D World with built-in API calls. Naviga...
// All keyboard stuff - Whats important here is the event.keyCode listeners which check for arrow keys for movement -> letter keys fo
// Array with keycodes for arrow keys, so we can quickly check if the input is one of them.
keyboard[event.keyCode] = true;
if (arrowKeys.includes(event.keyCode)) {
} else if (typeFlag === 1 && event.keyCode === 13) {
Lion Chase
464 runs ♦ 0 likes
By Martin Derwin  
Created: 30 Nov 2022
Modified: 17 Sep 2023
Don't get caught by the lions
return(OURKEYS.includes(event.keyCode));
if(event.keyCode == KEY_A) sendData(KEY_A, 2);
if(event.keyCode == KEY_W) sendData(KEY_W, 2);
if(event.keyCode == KEY_D) sendData(KEY_D, 2);
if(event.keyCode == KEY_LEFT)
AIRecipe
95 runs ♦ 0 likes
By Alex Petrash  
Created: 1 Dec 2023
Modified: 11 Sep 2024
User enters the name of a dish. Display list of ingredients, recipe and an image. Uses two API c...
if (event.keyCode == 13) {
Pacman In Space
1716 runs ♦ 0 likes
By Simon Lowry  
Created: 16 Nov 2016
Modified: 17 Sep 2023
if (e.keyCode == 37) moveLogicalAgent ( ACTION_LEFT );
if (e.keyCode == 38) moveLogicalAgent ( ACTION_DOWN );
if (e.keyCode == 39) moveLogicalAgent ( ACTION_RIGHT );
if (e.keyCode == 40) moveLogicalAgent ( ACTION_UP );
Chat with GPT model
924 runs ♦ 3 likes
By Starter user  
Created: 18 Sep 2023
Modified: 3 Oct 2023
JavaScript page to chat with a GPT model. Calls OpenAI API. User needs to enter API key.
document.getElementById('me').onkeydown = function(event) { if (event.keyCode == 13) sendchat(); };
AI Art Gallery
132 runs ♦ 0 likes
By Jamie Gorman  
Created: 21 Nov 2023
Modified: 11 Sep 2024
Art Gallery with AI generated images and background music. Calls image generation API from Repli...
switch (event.keyCode) {
switch (event.keyCode) {
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
switch (e.keyCode){
Shooting Range
402 runs ♦ 0 likes
By Enhanced  
Created: 13 Jun 2018
Modified: 17 Sep 2023
Shoot the ducks, feel the spirit of the hunt. Enhanced version of "Shooting Range (Space To Shoo...
if (e.keyCode == 37) moveLogicalAgent( ACTION_LEFT );
if (e.keyCode == 38) moveLogicalAgent( ACTION_DOWN );
if (e.keyCode == 39) moveLogicalAgent( ACTION_RIGHT );
if (e.keyCode == 40) moveLogicalAgent( ACTION_UP );
if (e.keyCode == 32) // if the keycode is space.
Shooting Range (...
2348 runs ♦ 4 likes
By Adrian Rabbitte  
Created: 16 Nov 2016
Modified: 17 Sep 2023
if (e.keyCode == 37) moveLogicalAgent ( ACTION_LEFT );
if (e.keyCode == 38) moveLogicalAgent ( ACTION_DOWN );
if (e.keyCode == 39) moveLogicalAgent ( ACTION_RIGHT );
if (e.keyCode == 40) moveLogicalAgent ( ACTION_UP );
if (e.keyCode == 32) // if the keycode is space.
Spider Paradise ...
766 runs ♦ 2 likes
By Aisling Casserly  
Created: 8 Dec 2016
Modified: 17 Sep 2023
if (e.keyCode == 37) moveLogicalAgent ( ACTION_LEFT );
if (e.keyCode == 38) moveLogicalAgent ( ACTION_DOWN );
if (e.keyCode == 39) moveLogicalAgent ( ACTION_RIGHT );
if (e.keyCode == 40) moveLogicalAgent ( ACTION_UP );
if (e.keyCode == 65) moveLogicalAgent ( JUMP_LEFT );
Capture The Egg
134 runs ♦ 0 likes
By tuitef2  
Created: 8 Mar 2019
Modified: 17 Sep 2023
keyboard[event.keyCode] = true;
keyboard[event.keyCode] = false;
Infinite World O...
99 runs ♦ 0 likes
By Enhanced  
Created: 16 Aug 2018
Modified: 17 Sep 2023
Here is a code to get an infinite world that loop without object in it, without the sun
if((e.keyCode == 38) || (e.keyCode == 40))
if(e.keyCode == 37 || e.keyCode == 39)
if(e.keyCode == 37 || e.keyCode == 39)
switch ( event.keyCode ) {
switch( event.keyCode ) {
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...
document.getElementById('me').onkeydown = function(event) { if (event.keyCode == 13) sendchat(); };
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...
keyboard[event.keyCode] = true;
keyboard[event.keyCode] = false;
Game of Crowns s...
220 runs ♦ 0 likes
By Enhanced  
Created: 21 Jun 2018
Modified: 17 Sep 2023
Enhanced version of "Game of Crowns" by Niamh Byrne with better graphics and controls
var code = a.keyCode;
if (e.keyCode == 37) { moveLogicalAgent ( ACTION_LEFT ); e.preventDefault(); }
if (e.keyCode == 40) { moveLogicalAgent ( ACTION_DOWN ); e.preventDefault(); }
if (e.keyCode == 39) { moveLogicalAgent ( ACTION_RIGHT ); e.preventDefault(); }
if (e.keyCode == 38) { moveLogicalAgent ( ACTION_UP ); e.preventDefault(); }
Infinite World G...
149 runs ♦ 0 likes
By Enhanced  
Created: 16 Aug 2018
Modified: 17 Sep 2023
Here is a code to get an infinite world that loop without object in it, and with the sun
if((e.keyCode == 38) || (e.keyCode == 40))
if(e.keyCode == 37 || e.keyCode == 39)
if(e.keyCode == 37 || e.keyCode == 39)
switch ( event.keyCode ) {
switch( event.keyCode ) {
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...
function ourKeys ( event ) { return ( OURKEYS.includes ( event.keyCode ) ); }
if ( event.keyCode == 37 ) moveLogicalAgent ( ACTION_LEFT );
if ( event.keyCode == 38 ) moveLogicalAgent ( ACTION_DOWN );
if ( event.keyCode == 39 ) moveLogicalAgent ( ACTION_RIGHT );
if ( event.keyCode == 40 ) moveLogicalAgent ( ACTION_UP );
Chess
5867 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
if (event.keyCode == 37) // If the left arrow is clicked then move the selector left
else if (event.keyCode == 38) // If the up arrow is clicked then move the selector up
else if (event.keyCode == 39) // If the right arrow is clicked then move the selector right
else if (event.keyCode == 40) // If the down arrow is clicked then move the selector down
else if (event.keyCode == 13) // If the Enter key is clicked then check what the user wants
Space Plane Shooter
848 runs ♦ 2 likes
By Brian Kilduff  
Created: 26 Nov 2016
Modified: 17 Sep 2023
if (e.keyCode == 37) moveLogicalAgent ( ACTION_LEFT ); //left arrow key
if (e.keyCode == 38 && jump1 == false) //up arrow key
if (e.keyCode == 39) moveLogicalAgent ( ACTION_RIGHT ); //right arrow key
if (e.keyCode == 66) moveLogicalAgent ( ACTION_DOWN ); //"b"key
if (e.keyCode == 32) //speace bar key fires bullets
Super Mario Maze
2279 runs ♦ 4 likes
By Cathal Neary  
Created: 19 Nov 2016
Modified: 17 Sep 2023
if (e.keyCode == 37) { moveLogicalAgent ( ACTION_LEFT ); e.preventDefault(); }
if (e.keyCode == 38) { moveLogicalAgent ( ACTION_DOWN ); e.preventDefault(); }
if (e.keyCode == 39) { moveLogicalAgent ( ACTION_RIGHT ); e.preventDefault(); }
if (e.keyCode == 40) { moveLogicalAgent ( ACTION_UP ); e.preventDefault(); }
if (e.keyCode == 32) { moveLogicalAgent ( ACTION_JUMP ); e.preventDefault(); }
Globe Trotter
1483 runs ♦ 2 likes
By Laura Araviciute  
Created: 3 Dec 2016
Modified: 17 Sep 2023
var code = event.keyCode;
Battleship
4285 runs ♦ 2 likes
By Aaron Crawford  
Created: 30 Oct 2022
Modified: 17 Sep 2023
if (e.keyCode == '38')
else if (e.keyCode == '40')
else if (e.keyCode == '37')
else if (e.keyCode == '39')
else if (e.keyCode == '13')
Find Woody's Hat
598 runs ♦ 1 like
By Benjamin Olojo  
Created: 4 Dec 2022
Modified: 11 Sep 2024
Clone of "Capture the Hat" by Tuomas Bazzan
if (e.keyCode == 37) moveLogicalAgent ( ACTION_LEFT );
else if (e.keyCode == 38) moveLogicalAgent ( ACTION_DOWN );
else if (e.keyCode == 39) moveLogicalAgent ( ACTION_RIGHT );
else if (e.keyCode == 40) moveLogicalAgent ( ACTION_UP );
else if (e.keyCode == 17) moveLogicalAgent ( ACTION_PAUSE ); // ctrl to mute


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.