Ancient Brain
Code. Play. Teach. Learn. Research. Demo.

Getting started

Here is a guide to getting started running Worlds and coding on Ancient Brain.

We have a text Introduction to the site.
And we have the following video introduction.
This video does not assume you have ever coded, or ever heard of JavaScript (what is behind this site).
See also:

You can "run" any World by clicking on it. No install needed.
Try running some of the Editor's Choice Worlds.

There are currently 11,702 Worlds on this site.
Here are a few random choice Worlds to try (reload for more):


First Person Con...
220 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...
Ammo physics demo
139 runs ♦ 0 likes
By Starter user  
Created: 19 Apr 2021
Modified: 17 Sep 2023
Port of "ammo / instancing" from Three.js examples
Binary tree
4257 runs ♦ 0 likes
By "Coding Train" p...  
Created: 25 Apr 2019
Modified: 17 Sep 2023
Binary tree search demo.
Wrong Way Motorway
1250 runs ♦ 0 likes
By James Reilly  
Created: 9 Aug 2023
Modified: 17 Sep 2023
Ca318 repeat practical

OK you are ready to code. All Worlds are coded in the JavaScript (JS) language. We use a JavaScript graphics "library" to help us code the 2D and 3D graphics.

We use two main graphics libraries: "P5" and "Three.js".

As a result we have two "starter tutorials", one for each library. So pick one. Don't worry, you can look at the other one later. If you do not know which to pick, pick P5.

 
 

If you want to know more about the two libraries

  • The P5 library has pluses and minuses:
    • It is easier to get into if you are a beginner coder.
    • It has features that may annoy non-beginners (global namespace taken up, timing loop controlled for you).
    • It is harder to do advanced graphics.
    • There are a number of P5 teaching courses on this site.

  • The Three.js library has pluses and minuses:
    • It is more intimidating for a beginner coder.
    • It is well suited to non-beginners.
    • It is designed for advanced graphics. Almost all the advanced graphics Worlds on this site are Three.js.
    • There is currently no Three.js teaching course here.

Having picked your graphics library, do the starter tutorial.

Using P5:

P5 Starter tutorial

Or using Three.js:

Three.js Starter tutorial

When coding, the Docs menu has all the help and reference that you need:

Docs
One Cube World (...
1219 runs ♦ 2 likes
By Starter user  
Created: 11 Apr 2018
Modified: 17 Sep 2023
Simple starter World (Three.js version). Built-in camera control.
One Cube World (P5)
2317 runs ♦ 1 like
By Starter user  
Created: 10 Nov 2018
Modified: 17 Sep 2023
Simple starter World (P5 version). No camera control. So cube rotates to show 3D.
  • Once you have seen how to code on Ancient Brain, the easiest way to progress is to start modifying existing Worlds.
  • Pick one of the Starter Worlds. "Clone" it, and edit your copy.
  • The easiest parts of the code to change are in the "tweaker's box" at the top.
Blank Three.js World
1763 runs ♦ 2 likes
By Starter user  
Created: 20 Nov 2016
Modified: 17 Sep 2023
A simple starter World. An Array of spheres. Painted with textures. Random motion.
MineCraft
1154 runs ♦ 2 likes
By Starter user  
Created: 27 Nov 2016
Modified: 17 Sep 2023
Use keyboard to draw blocks like in MineCraft. Use arrow keys and PgUp, PgDn to draw. Can save w...
Complex World
8339 runs ♦ 5 likes
By Starter user  
Created: 1 Oct 2016
Modified: 17 Sep 2023
World with a Mind-controlled agent, actively-pursuing enemy, random maze, skybox, music.
Simple World
1729 runs ♦ 2 likes
By Starter user  
Created: 1 Oct 2016
Modified: 17 Sep 2023
Simple World with a Mind-controlled agent, randomly-moving enemy, paint blocks with texture.
There are a number of coding courses and exercises on this site that you can do:
  • Introduction to Programming. This is a proper Introduction to Programming course, with videos, using JavaScript and P5. This does not assume you have ever written a program.

  • Introduction to Programming: Part Two.

  • Alternative JavaScript course for kids. This is an alternative introduction to programming, with kid-friendly language. This does not assume you have ever written a program.

  • WebGL course. This is a course in JavaScript 3D graphics ("WebGL") programming, using P5.

  • AI exercises. This does not have a full set of notes explaining AI theory. You will need to get that somewhere else. Rather this is a series of online AI programming exercises, with problems for students to solve. All code is in JavaScript using P5.


As well as courses, there are accounts with certain collections of Worlds:

P5 Editor porting project  
Port to Ancient Brain of P5 Editor built-in sketches. Source: editor.p5js.org/p5/sketches. Port ...

threejs.org porting project  
Project to port threejs.org examples. All credit to: https://github.com/mrdoob/three.js/tree/mas...

"Coding Train" project  
Project to port JS Worlds from The Coding Train to Ancient Brain.

"3D Game Programming for K...  
Proposed project to port code from the book "3D Game Programming for Kids" by Chris Strom. Await...

Discover three.js  
Project to port code from "Discover three.js" book and site by Lewy Blue. Done with permission o...

As you keep learning, here are some examples of what you can build on this site. Build something beautiful!
Complete Infinit...
523 runs ♦ 0 likes
By Enhanced  
Created: 9 Aug 2018
Modified: 17 Sep 2023
This program was made by Nathan Bonnard. In this world, you can generate an infinite world ! Bu...
The San Andreas ...
1028 runs ♦ 0 likes
By Effa  
Created: 1 Dec 2022
Modified: 17 Sep 2023
Expo World
218 runs ♦ 0 likes
By Mark Humphrys  
Created: 17 Oct 2018
Modified: 11 Sep 2024
Infinite changing demo for expos.
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...
My first world
430 runs ♦ 0 likes
By Sagnik Chakraborty  
Created: 19 Sep 2022
Modified: 17 Sep 2023
hopefully will be wonderful, but its scary for now lol
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!
Scare the Fishes!
222 runs ♦ 2 likes
By Enhanced  
Created: 2 Aug 2018
Modified: 17 Sep 2023
Scare the fishes with your mouse ! If you click they will flee even further away. Includes twea...
Websocket chat
997 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.