Uploaded November 2022 | Updated September 2026, 2 weeks ago
We learn how to listen to key events and how to play audio in JavaScript. We use these to make a Piano that works in the browser.
We learn how to listen to key events and how to play audio in JavaScript. We use these to make a Piano that works in the browser.


![A Virtual World - JavaScript Course: Lesson 2 / 11 [Graph Editor with JavaScript]
Welcome to the course where we build a self-driving car simulation in a virtual world. In this video Ill teach you how to build a graph editor from scratch, using basic HTML, CSS and JavaScript. The graph will act as a basis and the world will be generated according to it.
In this digital age, a good user interface should streamline interactions, minimizing the need for excessive clicks and keyboard inputs. Ill teach you how to do this when making a graph editor and how to think like this in general.
Throughout this series, Ill guide you step by step, showcasing how to build a graph editor with a primary focus on mouse interaction. The mouse is a versatile tool, and in this course, we use it to add, drag, remove points effortlessly. 🖱️
Well start from the basics, gradually implementing new features and refining existing ones, all with the aim of achieving a final logic thats not only functional but also intuitive. By the end, youll not only have a graph editor to be proud of but also the skills to customize it to your hearts content.
Have Fun! :-)
⭐PLAYLIST⭐
https://www.youtube.com/playlist?list=PLB0Tybl0UNfZtY5IQl1aNwcoOPJNtnPEO
⭐FINAL APP⭐
https://radufromfinland.com/projects/virtualworld
💻CODE💻
https://github.com/gniziemazity/virtual-world
1. Spatial Graphs = follow along
2. Graph Editor = code after this lesson
⭐ALL PREREQUISITES⭐
https://www.youtube.com/playlist?list=PLB0Tybl0UNfZ3nnHVg8SJ4uK3R4QD6R0H
⭐Pythagorean Theorem Video⭐
https://youtu.be/iqSlzYXdFzw
☕Buy me a Coffee?☕
https://www.buymeacoffee.com/radum
⚡️Join this Channel⚡️
https://youtube.com/@radu/join
⭐Timestamps⭐
00:00 Introduction
01:09 Top-level Code Structure
03:21 Adding Points
06:06 Selecting Points
17:35 Removing Points
22:05 Dragging Points
24:54 Creating Segments
35:03 Debugging / Fine-tuning A Virtual World - JavaScript Course: Lesson 2 / 11 [Graph Editor with JavaScript]](https://i.ytimg.com/vi/_HkGH2WN_Tg/mqdefault.jpg)
![HTML Canvas Mouse Interaction
We learn how to interact with the mouse on an HTML Canvas.
Course playlist:
https://www.youtube.com/playlist?list=PLB0Tybl0UNfb6BvBPePaiCNOFpzxeE86R
⭐ MY CANVAS PROJECTS ⭐
1. Matrix Camera Effect https://youtu.be/GmB0ge-CuZo
2. Self Driving Car https://youtu.be/NkI9ia2cLhc
3. Puzzle Cam https://youtu.be/Z6fQtNpB3hU
4. Many more on my channel [ Its mostly about that :-) ] HTML Canvas Mouse Interaction](https://i.ytimg.com/vi/_KqjrGHSUew/mqdefault.jpg)


![A Virtual World - JavaScript Course: Lesson 6 / 11 [Pseudo 3D with JavaScript]
Welcome to the course where we build a self-driving car simulation in a virtual world.
In this video, we learn a way to make our items 3D. While you could certainly add some sprites to your existing 2D interface, creating a 3D look is a whole different experience.
Ive previously demonstrated how to use images for adding cars, and even offered tips for recoloring sprites in previous tutorials. But what if youre aiming for a genuine 3D appearance? You could completely refactor your application to utilize a 3D rendering engine. Like:
⭐ Bretto ported the code from Phase 1 to ThreeJS:
https://github.com/Bretto/evolution
⭐ @davidmurphy563 ported the code from Phase 1 to Godot:
https://youtu.be/FJFrSCEWqLU?si=toU4O43h2oaJmKUy
I want to teach you a way to get the 3D look without using a 3D engine because I find this effect visually appealing, and its surprisingly straightforward to implement.
Beyond the visual aspect, you may also find the underlying mathematics intriguing. While 3D renderers primarily employ triangles or voxels, our focus wont involve these elements. Nonetheless, this exploration touches upon fundamental principles of 3D rendering, providing insights into how these complex systems function.
Have Fun! :-)
⭐PLAYLIST⭐
https://www.youtube.com/playlist?list=PLB0Tybl0UNfZtY5IQl1aNwcoOPJNtnPEO
⭐FINAL APP⭐
https://radufromfinland.com/projects/virtualworld
💻CODE💻
https://github.com/gniziemazity/virtual-world
5. Buildings And Trees = follow along
6. Fake 3D = code after this lesson (including the part for channel members)
⭐ALL PREREQUISITES⭐
https://www.youtube.com/playlist?list=PLB0Tybl0UNfZ3nnHVg8SJ4uK3R4QD6R0H
⭐My Video on the Euclidean Distance⭐
https://youtu.be/3rPwfmrCwVw
☕Buy me a Coffee?☕
https://www.buymeacoffee.com/radum
⚡️Join this Channel⚡️
https://youtube.com/@radu/join
⭐Timestamps⭐
00:00 Introduction
01:29 Creating the Tree Object
05:08 Explaining the 3D approach
10:47 Styling the 3D Trees
16:02 Random number generation
20:35 Creating the Building Object A Virtual World - JavaScript Course: Lesson 6 / 11 [Pseudo 3D with JavaScript]](https://i.ytimg.com/vi/aKzlooeJNM8/mqdefault.jpg)
![🕯️Magic Candle🕯️JavaScript Project [With Device Orientation sensor]
Ill be coding a simple candle simulation where the flame always points up (even if you rotate the device). 🕯️Magic Candle🕯️JavaScript Project [With Device Orientation sensor]](https://i.ytimg.com/vi/avxStAp0mco/mqdefault.jpg)


