Drag the background!

Ancient Brain Starter Tutorial (P5)

This tutorial shows you how to get started on Ancient Brain (P5 version).

To be precise, this shows how to start coding on Ancient Brain in the JavaScript programming language, using the P5 library for the graphics. (You can use other libraries for graphics, notably Three.js.)

On Ancient Brain, you can edit and run programs in the browser, with no install. You have to register and get a username if you want to save your creations.

This tutorial will show you how to copy and edit a simple "World" called "One Cube World". (Click on World image to run it.)

One Cube World (P5)
2334 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.
You will soon be able to make variants of this World, such as the ones shown here.
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
One Cube World (...
198 runs ♦ 0 likes
By Colin Duggan  
Created: 4 Oct 2021
Modified: 17 Sep 2023
Clone of "One Cube World (P5)" by Starter user
Interstellar cubes
663 runs ♦ 3 likes
By Thomas Mc Cann  
Created: 16 Oct 2019
Modified: 17 Sep 2023
A journey into Interstellar space. Run and press F12 (in chrome) to view the console. Try left c...
Spaghett
352 runs ♦ 3 likes
By Theo Delettre  
Created: 30 Sep 2021
Modified: 17 Sep 2023
Clone of "One Cube World (P5)" by Starter user

Contents

  1. Register and login
  2. Run the Starter World
  3. Clone the Starter World
  4. Edit your World
  5. First look at the code
  6. Change some code
  7. Program structure
  8. Paint the cube
  9. Upload your own image
  10. Make another box
  11. Make lots of boxes
  12. Add music
  13. Errors
  14. Documentation
  15. Clone and edit other P5 Worlds
  16. Finish


Notes

  • Use buttons (or back and forward arrow keys) to move through the tutorial.
  • This tutorial does not assume you have ever done any computer programming (or "coding") before.
  • This is not a full course in programming. For that see the Introduction to Programming course.
  • Rather, this explains how to use Ancient Brain. As such, it serves as a gentle introduction to the idea of coding itself.


Get started

Enough talk. Let's start the tutorial!
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.