Search JS code (of Worlds)

Search JavaScript code of all Worlds for: keycode


Infinite World O...
45 runs ♦ 0 likes
By Enhanced  
Created: 16 Aug 2018
Modified: 17 Aug 2018
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 ) {
Touch World
291 runs ♦ 1 like
By Starter user  
Created: 6 Jan 2018
Modified: 20 Aug 2019
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 );
MineCraft
609 runs ♦ 2 likes
By Starter user  
Created: 27 Nov 2016
Modified: 20 Aug 2019
Use keyboard to draw blocks like in MineCraft. Use arrow keys and PgUp, PgDn to draw. Can save w...
function ourKeys ( event ) { return ( OURKEYS.includes ( event.keyCode ) ); }
if ( event.keyCode == 37 ) theobject.position.x = cx - objectsize ; // left
if ( event.keyCode == 39 ) theobject.position.x = cx + objectsize ; // right
if ( event.keyCode == 38 ) theobject.position.z = cz - objectsize ; // forward
if ( event.keyCode == 40 ) theobject.position.z = cz + objectsize ; // back
if ( event.keyCode == 34 ) theobject.position.y = cy - objectsize ;
if ( event.keyCode == 33 ) theobject.position.y = cy + objectsize ;
Zombie Death Baby
400 runs ♦ 0 likes
By Starter user  
Created: 11 Jun 2018
Modified: 20 Aug 2019
How to make a fun touch game for mobile. Touch drag and tap objects. Mouse drag and click object...
function ourKeys ( event ) { return ( OURKEYS.includes ( event.keyCode ) ); }
if ( event.keyCode == 37 ) moveAgent ( ACTION_LEFT );
if ( event.keyCode == 38 ) moveAgent ( ACTION_DOWN );
if ( event.keyCode == 39 ) moveAgent ( ACTION_RIGHT );
if ( event.keyCode == 40 ) moveAgent ( ACTION_UP );
User-controlled ...
426 runs ♦ 2 likes
By Starter user  
Created: 12 Feb 2017
Modified: 20 Aug 2019
3d model World. User controlled on desktop. Keyboard arrows to move. Switch to "Move with" camer...
function ourKeys ( event ) { return ( OURKEYS.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 )
Infinite World G...
60 runs ♦ 0 likes
By Enhanced  
Created: 16 Aug 2018
Modified: 16 Aug 2018
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 ) {
Minecraft Builder
120 runs ♦ 0 likes
By Enhanced  
Created: 5 Jun 2018
Modified: 21 Jun 2018
Build your own worlds. Enhanced version of the Minecraft starter world with added control and co...
if ( e.keyCode == leftInput ) { cursor.position.x += - objectsize ; e.preventDefault(); } // left
if ( e.keyCode == rightInput ) { cursor.position.x += + objectsize ; e.preventDefault(); } // right
if ( e.keyCode == forwardInput ) { cursor.position.z += - objectsize ; e.preventDefault(); } // forward
if ( e.keyCode == backwardInput ) { cursor.position.z += + objectsize ; e.preventDefault(); } // back
if ( e.keyCode == bottomInput ) { cursor.position.y += - objectsize ; e.preventDefault(); }
if ( e.keyCode == topInput ) { cursor.position.y += + objectsize ; e.preventDefault(); }
if ( e.keyCode == 13 ) // Enter key pressed
if ( e.keyCode == 46 ) { //delete button pressed
Complete Infinit...
303 runs ♦ 0 likes
By Enhanced  
Created: 9 Aug 2018
Modified: 26 Aug 2018
This program was made by Nathan Bonnard. In this world, you can generate an infinite world ! Bu...
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 ) {
Enhanced Space Pong
115 runs ♦ 0 likes
By Enhanced  
Created: 18 Jun 2018
Modified: 10 May 2019
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;
Shooting Range
100 runs ♦ 0 likes
By Enhanced  
Created: 13 Jun 2018
Modified: 21 Jun 2018
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.
Final Pool
775 runs ♦ 2 likes
By Ian Gilligan  
Created: 1 Mar 2019
Modified: 13 Aug 2019
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);}
Romantic Sunset
79 runs ♦ 0 likes
By Enhanced  
Created: 17 Aug 2018
Modified: 10 May 2019
Turn your head and discover a eautiful scenery observable in first person mode.
switch ( event.keyCode ) {
switch( event.keyCode ) {
Capture The Egg
30 runs ♦ 0 likes
By tuitef2  
Created: 8 Mar 2019
Modified: 11 Mar 2019
keyboard[event.keyCode] = true;
keyboard[event.keyCode] = false;
Game of Crowns s...
104 runs ♦ 0 likes
By Enhanced  
Created: 21 Jun 2018
Modified: 27 Aug 2018
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(); }
Enhanced Don't Move
60 runs ♦ 0 likes
By Enhanced  
Created: 12 Jun 2018
Modified: 27 Jun 2018
Try to dodge cubes as they fall to the ground, in this simple but efficient game
var code = event.keyCode;
Bomberman
134 runs ♦ 0 likes
By Enhanced  
Created: 21 Jun 2018
Modified: 21 Jun 2018
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)
Design Your Own ...
4289 runs ♦ 0 likes
By Jack O'Connor  
Created: 18 Feb 2019
Modified: 12 Mar 2019
Design Your Own Room Escape Game
if (keyCode === LEFT_ARROW)
else if (keyCode === RIGHT_ARROW)
if (keyCode === DOWN_ARROW && deg == 360)
Pacman
116 runs ♦ 0 likes
By Enhanced  
Created: 21 Jun 2018
Modified: 17 Aug 2018
Enhanced version of Game Pacman in Space, you need to collect all white bullet to end the game, ...
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 );
Rythm of the night
116 runs ♦ 0 likes
By Enhanced  
Created: 2 Aug 2018
Modified: 2 Aug 2018
A rythm game where you have to use the right inputs at the right time to progress from one level...
//it can take the values 38 to 41. The html keycode of the arrow keys goes
if (e.keyCode == 37 || e.keyCode == 38 || e.keyCode == 39 || e.keyCode == 40)
if (actionRequired !== undefined && e.keyCode == obstacles[actionRequired])
//by the keycode of that arrow)(70% of the time) either nothing (represented
Game of Crowns
1673 runs ♦ 2 likes
By Niamh Byrne  
Created: 16 Nov 2016
Modified: 10 Feb 2018
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(); }
Pacman In Space
1460 runs ♦ 0 likes
By Simon Lowry  
Created: 16 Nov 2016
Modified: 10 Feb 2018
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 );
Super Mario Maze
1919 runs ♦ 4 likes
By Cathal Neary  
Created: 19 Nov 2016
Modified: 10 Feb 2018
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(); }
Looney Tunes Cha...
1247 runs ♦ 2 likes
By Sean Sinnott  
Created: 16 Nov 2016
Modified: 10 Feb 2018
if (e.keyCode == 37)
if (e.keyCode == 38)
if (e.keyCode == 39)
if (e.keyCode == 40)
if (e.keyCode == 83)
Catch the flag
4180 runs ♦ 1 like
By Meabh Horan  
Created: 16 Nov 2016
Modified: 10 Feb 2018
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
FLESHMAN PLAYS G...
4392 runs ♦ 2 likes
By Sean Hutchinson  
Created: 21 Oct 2016
Modified: 10 Feb 2018
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
if (e.keyCode == 98) // numpad2 is shot
if (e.keyCode == 99) // numpad3 is drive
Election - AI Ve...
1885 runs ♦ 3 likes
By Ross Franey  
Created: 22 Oct 2016
Modified: 10 Feb 2018
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) ai = randomintAtoB(1,gridsize-2), aj = randomintAtoB(1,gridsize-2);
Space Plane Shooter
568 runs ♦ 2 likes
By Brian Kilduff  
Created: 26 Nov 2016
Modified: 10 Feb 2018
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
Globe Trotter
1337 runs ♦ 2 likes
By Laura Araviciute  
Created: 3 Dec 2016
Modified: 10 Feb 2018
var code = event.keyCode;
Don't Move
1172 runs ♦ 1 like
By Finnian O'Neill  
Created: 6 Dec 2016
Modified: 10 Feb 2018
var code = event.keyCode;
Shooting Range (...
2166 runs ♦ 4 likes
By Adrian Rabbitte  
Created: 16 Nov 2016
Modified: 10 Feb 2018
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.


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

© Ancient Brain Ltd. 2018-19. All rights reserved.

Ancient Brain ™ is a trademark of Ancient Brain Ltd.

Platforms      Stats      The name      Terms and conditions

Bug bounty      Classes in Dublin      Contact

Call for partners
If you are interested in writing a programming course or textbook, Ancient Brain is looking for partners. We will work with you, and integrate your course into the site. This is an opportunity for someone looking to develop a course or textbook to partner with a site to support it and promote it.