Go to Steam Discussions
View on GitHub
VERSION 0.2.3
![]() |
CURSOR ENTER |
![]() |
CURSOR EXIT |
![]() |
CURSOR DOWN |
![]() |
CURSOR UP |
![]() |
OBJECT SPAWNED |
![]() |
OBJECT REMOVED |
![]() |
OBJECT REMOVED BY NETWORK |
![]() |
RENDER TICK |
![]() |
PRECACHE |
![]() |
INITIALIZE |
![]() |
READY |
![]() |
RENDER TICK |
![]() |
CURSOR DOWN |
![]() |
CURSOR UP |
// Specify the non-default options to use. var myOptions = { "appID": "MyAppID", "sceneScale": 2.0, "multiuserOnly": true, "enclosureOnly": true, "scaleWithEnclosure": true, "debug": {"showCursorPlanes": false} }; // Load JumpStart. loadJumpStart(myOptions);
jumpStart.addEventListener("precache", function() { var myModels = ["models/car", "models/explosion"]; jumpStart.loadModels(myModels).then(function() { // Indicate that precaching is complete. jumpStart.doneCaching(); }); return false; // False indicates ASYNCHRONOUS precaching. });
jumpStart.addEventListener("ready", function() { // Load in some last minute stuff var imageElem = new Image(); imageElem.addEventListener("load", function() { // Alright, NOW we are ready to start the game. jumpStart.run(); }); imageElem.src = "http://www.mydomain.com/picture.jpg"; return false; // False indicates we are not ready yet. });
jumpStart.addEventListener("precache", function() { // Define all of the models we want to load. var myModels = ["models/car", "models/explosion"]; // Load all of these models. jumpStart.loadModels(myModels).then(function() { // All models are done loading. jumpStart.doneCaching(); }); return false; });
jumpStart.addEventListener("ready", function() { // Have a world-space position to test. var pos = new THREE.Vector3(123.4, 567.9, 910.11); // Test it. if( jumpStart.isWorldPosInsideOfEnclosure(pos) ) console.log("Yes."); else console.log("No."); return; });
jumpStart.addEventListener("ready", function() { // Configure non-default options. var myOptions = { "width": "auto", "height": 12, "text": "Hello World", "fontSize": 12, "color": "rgba(255,255,255,1.0)", "background": "rgba(0,0,0,1.0)", "backgroundImageElem": null }; // Spawn the text plane var myObject = jumpStart.spawnTextPlane(options); return true; });
jumpStart.addEventListener("ready", function() { // Configure non-default options. var myOptions = { "width": "auto", "height": 12, "text": "Hello World", "fontSize": 12, "color": "rgba(255,255,255,1.0)", "background": "rgba(0,0,0,1.0)", "backgroundImageElem": null }; // Spawn the text plane var myObject = jumpStart.spawnTextPlane(options); // Wait for an event to happen. myObject.addEventListener("cursorenter", function() { // Use the same options as before, but new text. myOptions.text = "How are you?"; // Update the text plane. jumpStart.updateText(this, myOptions); }); return true; });
jumpStart.addEventListener("ready", function() { // Configure non-default options. var myOptions = { "width": jumpStart.enclosure.scaledWidth, "height": jumpStart.enclosure.scaledHeight, "parent": jumpStart.world }; // Spawn the text plane. var myObject = jumpStart.spawnCursorPlane(options); // Make it solid. myObject.blocksLOS = true; // Wait for an event to happen. myObject.addEventListener("tick", function() { // Make sure we are being hovered. if( jumpStart.localUser.cursorHit && jumpStart.localUser.cursorHit.object === this ) { // Output the cursor position. console.log(jumpStart.localUser.cursorHit.scaledPoint); } }); return true; });
jumpStart.addEventListener("ready", function() { // BoundaryIDs: floor, ceiling, north, east, south, west // Get (or create) a cursor plane for the floor of the enclosure. var boundary = jumpStart.enclosureBoundary("floor"); // Add an event when somebody clicks on the floor. boundary.addEventListener("cursordown", function() { console.log("You clicked the floor!"); }); return true; });
jumpStart.addEventListener("precache", function() { // Start loading the sound. // NOTE: The sound will not be ready to play right away. jumpStart.precacheSound("sounds/explosion"); return true; }); jumpStart.addEventListener("ready", function() { // Spawn a cursor plane to interact with. var myObject = jumpStart.spawnCursorPlane(); // Make it solid. myObject.blocksLOS = true; // Wait for an event to happen. myObject.addEventListener("cursordown", function() { // Either resume the loop, or start it up for the first time. if( !!this.userData.mySound ) this.userData.sound.source.start(0); else this.userData.mySound = jumpStart.playSound("sounds/explosion", 1.0, true); }); // Wait for a different event to happen. myObject.addEventListener("cursorup", function() { // Stop the sound. this.userData.mySound.source.stop(0); }); return true; });
jumpStart.addEventListener("precache", function() { // Start loading the sound. // NOTE: The sound will not be ready to play right away. jumpStart.precacheSound("sounds/explosion"); return true; }); jumpStart.addEventListener("ready", function() { // Spawn a cursor plane to interact with. var myObject = jumpStart.spawnCursorPlane(); // Make it solid. myObject.blocksLOS = true; // Wait for an event to happen. myObject.addEventListener("cursordown", function() { // Either resume the loop, or start it up for the first time. if( !!this.userData.mySound ) this.userData.sound.source.start(0); else this.userData.mySound = jumpStart.playSound("sounds/explosion", 1.0, true); }); // Wait for a different event to happen. myObject.addEventListener("cursorup", function() { // Stop the sound. this.userData.mySound.source.stop(0); }); return true; });
jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/car"]).then(function() { // Configure non-default options. var myOptions = { "parent": jumpStart.world }; // Spawn a car. var myObject = jumpStart.spawnInstance("models/car", myOptions); // We are ready now. jumpStart.run(); }); return false; });
jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/car"]).then(function() { // Configure non-default options. var myOptions = { "parent": jumpStart.world }; // Spawn a car. var myObject = jumpStart.spawnInstance("models/car", myOptions); // Make it solid. myObject.blocksLOS = true; // Wait for an event to happen. myObject.addEventListener("cursorup", function() { // Remove us. jumpStart.removeInstance(this); }); // We are ready now. jumpStart.run(); }); return false; });
// Game System Events: precache, initialize, ready, tick, cursordown, cursorup // Wait for an event to happen. jumpStart.addEventListener("cursordown", function() { console.log("Local user clicked on something!"); });
// Game System Events: precache, initialize, ready, tick, cursordown, cursorup // Wait for an event to happen. jumpStart.addEventListener("cursordown", function() { console.log("Local user clicked on something!"); // arguments.callee gives us the current function. var selfFunc = arguments.callee; // Stop listening for this event. jumpStart.removeEventListener("cursordown", selfFunc); });
jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/car"]).then(function() { // Spawn a car. var myObject = jumpStart.spawnInstance("models/car"); // Change the color of the car. var myColor = new THREE.Color("#00ff00"); myObject.setColor(myColor); // We are ready now. jumpStart.run(); }); return false; });
jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/car"]).then(function() { // Spawn a car. var myObject = jumpStart.spawnInstance("models/car"); // Each behavior has its own unique options. var myOptions = {"force": new THREE.Vector(0, 7.5, 0)}; // Toss the car straight up into the air. myObject.applyBehavior("physics", myOptions); // We are ready now. jumpStart.run(); }); return false; });
jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/ball"]).then(function() { // Spawn a ball. var myObject = jumpStart.spawnInstance("models/ball"); // Make the ball physics-controlled. myObject.applyBehavior("physics"); // Wait for an event to happen. myObject.addEventListener("cursordown", function() { // Stop the ball & remove the physics behavior. this.unapplyBehavior("physics"); }); // We are ready now. jumpStart.run(); }); return false; });
jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/ball"]).then(function() { // Spawn a ball for this client. var myObject = jumpStart.spawnInstance("models/ball"); // Attach some synced data. myObject.syncData.team = 0; // Sync it to the multiuser session so it exists on all clients. myObject.sync(); // We are ready now. jumpStart.run(); }); return false; });
// Object Events: cursorenter, cursorexit, cursordown, cursorup, spawn, remove, networkRemove, tick jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/car"]).then(function() { // Spawn a car. var myObject = jumpStart.spawnInstance("models/car"); // Wait for an event to happen. myObject.addEventListener("tick", function() { // Spin this car. var amount = 5.0 * jumpStart.deltaTime; this.rotateY(amount); }); // We are ready now. jumpStart.run(); }); return false; });
// Object Events: cursorenter, cursorexit, cursordown, cursorup, spawn, remove, networkRemove, tick jumpStart.addEventListener("ready", function() { // Load a model to use. jumpStart.loadModels(["models/car"]).then(function() { // Spawn a car. var myObject = jumpStart.spawnInstance("models/car"); // Wait for an event to happen. myObject.addEventListener("cursordown", function() { // Make this car twice as big. this.scale.multiplyScalar(2.0); // arguments.callee gives us the current function. var selfFunc = arguments.callee; // Stop listening fot his event. this.removeEventListener("cursordown", selfFunc); }); // We are ready now. jumpStart.run(); }); return false; });
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was built on an outdated version of JumpStart.
This app was NOT built on JumpStart.