
Build single and multiplayer games with Babylon.js in JavaScript, from vehicle-based scenes and tank combat to physics, particles, and multiple cameras, then deploy to Heroku with realtime client-server play.
Hi, Please Note That Different Code Files Are Available Per Section, So That You Work With Me Step By Step.
After You Extract The Folder Go To SinglePlayer/js/Lectuer-Codes, Where You Will Find Code Files For Each Section
Set up your Babylon.js development environment for single and multiplayer games by choosing a code editor, creating a JavaScript project, installing Python HTTP server, and loading the Babylon.js max file.
Create your first Babylon.js scene by setting up a canvas, engine, and scene; add a sphere, ground, and point light, configure a camera, and render in a loop.
Explore how lights, colors, materials, and textures shape a Babylon.js scene, including ambient, diffuse, and specular colors, real-time reflections, textures, and bump maps.
Explore how to apply diverse materials to objects in Babylon.js, including ambient, diffuse, specular, emissive properties, textures, reflection textures, alpha, normal maps, and video textures.
Build terrain from a height map with grass texture, then enable a gravity-enabled, colliding camera and directional lighting for transitions to new levels.
Enable WASD movement and pointer lock to rotate freely while keeping the cursor inside the game, using cross-browser event handling in a Babylon.js scene.
Build a Babylon.js scene where a dude follows the tank by computing the direction, normalizing it, and moving toward the tank within a set distance.
Create a JavaScript class to clone and manage multiple dudes, implementing a move function with mesh positions and collisions, and instantiate multiple instances in preparation for the next video.
Learn how to implement a bounding box for collision detection in Babylon.js to curb per-part checks, by computing min/max vertex coordinates in model space and applying transforms for correct scaling.
Implement per-dude bounding boxes by computing model-space dimensions once with a static class variable, then update each bounding box from child positions and current scaling in Babylon.js.
Explore how forces and impulses affect objects in a Babylon.js scene, showing how mass governs acceleration and impulse changes velocity, including translational and rotational torque effects.
Explore advanced physics features in Babylon.js: explosions, a gravitational field, and collision callbacks, with debug visuals and timing controls.
Enable scene physics, fire cannonballs from the tank with impulse forces and the front vector, and dispose balls after a timeout to optimize memory.
Learn to fire laser beams with ray casting in Babylon.js, defining origin and direction, rendering visible rays, and detecting intersections with scene meshes.
Explore particle systems in Babylon.js to simulate blood effects when hit, using textures and emission centers, and colors, lifetimes, gravity, and start/stop controls.
Discover how the assets manager loads scenes, models, textures, and sounds in a Babylon.js game, with progress callbacks and a render only after all assets are loaded.
Load the dude model with the assets manager by configuring a mesh task, handling on success to call the imported function with loaded meshes, particle systems, and skeletons.
Develop a realistic first-person shooter feel by adding a photo camera to follow the hero and a separate follow camera with keyboard switches.
Use a downward ray to measure ground height under the character. Then update the character and bounding box position for uneven terrain in Babylon.js.
Explore implementing a first-person free camera in Babylon.js, handling ground physics and collisions, and switching between free and follow cameras while syncing position and view direction.
Learn to create keyframe animations inside Babylon.js by animating the camera’s alpha, beta, and radius with animation objects, set keys, and loop modes such as cycle, relative, or constant.
Develop a modular multi-level architecture by treating each level as a scene within a game object that holds a scenes array and an active scene index, enabling seamless transitions.
Create a cylindrical portal in the first level to transfer the tank to the second level, using an action manager to switch scenes and vary ground colors by active scene.
Deploy a single-player web game to Heroku by turning it into a web application, initializing a git repo, and pushing to a Heroku app while aligning assets and casing.
Install the latest stable node.js and complete the setup, then verify by typing node -v in the command prompt, with npm installed by default to support immediate development workflows.
Create a node http server by requiring the http module, listen on port 3000, handle requests with request and response objects, and note Express as a popular routing option.
Initialize a node project with npm init, install Express using npm install --save, and build a minimal Express server that handles get requests for pages and returns simple messages.
Run the game on a node server by copying the single-player files into a multiplayer project and serving with express static, then enable automatic restarts with Nordman.
Learn how websockets establish a persistent client-server connection for real-time multiplayer gameplay, enabling instant updates of players' positions and orientation, new joins, and removals across all clients.
When a new client connects, the server announces your arrival. It broadcasts existing tanks' positions and rotations, colors your tank blue and enemies red, and stores states by id.
Update tank state on movement and notify the server only when position or rotation changes, then broadcast the new state to all clients for cross‑client tank synchronization.
Welcome to The Extensive Webgl Series - Part II - Single And Multiplayer Online Client-Server 3D Game Development Using WebGL's BabylonJs.
This is the second course in my extensive webgl series. While watching the first course first is recommended, it is not a strict prerequisite for this second course.
In This course you will learn how to create 3D Games inside BabylonJS. BabylonJs is a very nice 3d game engine written in Javascript, that allows creating very nice games quickly and effectively to be run directly on the browser.
The course is divided into two main sections : The Single-player section, and the Multi-player section.
In The single-player section you will learn the following :
In the multiplayer section you will learn the following :