Search the Community
Showing results for tags 'navigation'.
-
New free game: The Forest See https://www.myforest.uk and documentation at https://www.grelf.net/ojsvg.html This is a redevelopment in HTML5/JavaScript combining two much earlier programs, "The Forest" and "Explorer", which I wrote and had published in the 1980s for the TRS-80, Sinclair Spectrum and BBC Micro. It is partly a simulation of the sport of orienteering and an aid to interpreting contour maps but there are several diversions for non-orienteers, including a challenging treasure hunt. It is set in a vast forest, effectively infinite. This rewrite demonstrates how powerful the HTML5/JavaScript platform can be. Detailed maps and complicated scenes are displayed in fractions of a second. The program should run on any device that has a browser, from desktop PC to smartphone; it works on my cheap Android phone even in battery-saver mode. A friend tells me it works on her Kindle tablet. Older devices may not be fast enough though. Despite the huge extent of the terrain, the game downloads and runs in seconds because the program is only about 120 kilobytes (yes, kilo!). And there is nothing to install. I do not use any third party libraries. I deliberately use only the basic 2D graphics context because others, such as WebGL, are not available on all devices. Please feed back to me (gr at grelf dot net) details of any device that you find it doesn't work on. Tell me make and model, and particularly the operating system and browser (with version), and what doesn't work. The program and its source are freely available, uncompressed, because I want to encourage others to program creatively on the HTML5/JavaScript platform. I am writing on my personal web site about how it works. Lots of background information can be found at https://www.grelf.net/ojsvg.html and other pages linked from there, including my free JavaScript course. I think HTML5/JavaScript is a good combination for rewriting retro games and making them available to all, rather than emulating the cumbersome old machines in software or physically reproducing them, as some are doing. Reprogramming is more work of course but it can be very satisfying (and JavaScript is much easier to write than assembler). The technology now makes it possible to write what I really had in mind back in the 80s.
-
- orienteering
- javascript
-
(and 2 more)
Tagged with:
-
Hy guys, I've been trying to make a pg on how I can navigate a mesh that's always on the surface of a sphere..sorry I can't reproduce a PG, but I can explain further in case
-
U3D - BabylonJS Toolkit using Babylon-Navigation-Mesh Extension Wanadev Lyon, France http://wanadev.fr/ Check out the current implementation of navigation meshes and path finding: http://mackey.cloud/files/videos/u3dnavigation.mp4
-
Hello everyone, I would like to achieve a similar demo in babylonjs effect. Click on the Digit Transform camera view. How can I add text in the babylonjs scenes tag and add a click for it after the camera event. demo URL:https://sketchfab.com/models/8d212cd674a54d18ba624c9ed8be56f7
- 2 replies
-
- tags
- navigation
-
(and 1 more)
Tagged with:
-
Hi, I am curious if anyone has used the GamePad to do any type of menu navigation? I would like to be able to support the menu fully with the GamePad just curious if anyone else has done this and has some tips. I am currently using DOM elements for my menu but I am happy to do whatever works best for BabylonJS. Thanks, Matt
-
I needs to do simulations on the key keyboard. I know how to do it in a clean js: /* Touch Screen */var bodi=document.getElementsByTagName("body")[0];var triggerKeyboardEvent = function(el,keyC,typeKey){ var eventObj=document.createEvent("Events"); eventObj.initEvent(typeKey, true, true); eventObj.keyCode = keyC; eventObj.which = keyC; el.dispatchEvent(eventObj); }; var buttonLeft=document.getElementById("button-left"), buttonRight=document.getElementById("button-right"), buttonUp=document.getElementById("button-up");buttonLeft.addEventListener('touchstart',function(e){triggerKeyboardEvent(bodi,37,"keydown");e.preventDefault();},false);buttonLeft.addEventListener('touchend',function(e){triggerKeyboardEvent(bodi,37,"keyup");e.preventDefault();},false);buttonRight.addEventListener('touchstart',function(e){triggerKeyboardEvent(bodi,39,"keydown");e.preventDefault();},false);buttonRight.addEventListener('touchend',function(e){triggerKeyboardEvent(bodi,39,"keyup");e.preventDefault();},false);buttonUp.addEventListener('touchstart',function(e){triggerKeyboardEvent(bodi,38,"keydown");e.preventDefault();},false); buttonUp.addEventListener('touchend',function(e){triggerKeyboardEvent(bodi,38,"keyup");e.preventDefault();},false);/* End Touch Screen */But I know that Phaser offers its own methods. buttonRight = game.add.button(100, 300, 'buttonRight', function(){}, this); buttonRight.fixedToCamera = true; buttonRight.input.onTouchStart=function(){triggerKeyboardEvent(bodi,39,"keydown");} buttonRight.input.onTouchEnd=function(){triggerKeyboardEvent(bodi,39,"keyup");} This of course does not work ... Can anyone help me?
-
Hello, First of all I would like to say, you guys have done awesome job and hope you will add more features. I really appreciate the team for developing such a nice lightweight engine, its pretty awesome. I am facing a problem in camera collision with box. I have used FreeCamera so that I can have a FPS kind of effect. For that I made a ground, box. While I am going near to the box somehow the camera is going little inside the box. Here is my html code: <!DOCTYPE html><html><head> <meta charset="utf-8" /> <title>TestBabylon</title> <script src="js/babylon.js"></script> <script src="js/hand.minified-1.2.js"></script> <script src="js/customeCode.js"></script> <script src="js/Oimo.js"></script> <script src="js/cannon.js"></script> <style> html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; } #renderCanvas { width:100%; height:100%; } </style></head><body> <canvas id="renderCanvas"></canvas></body></html> Here is my js Code: /// <referance path "/js/babylon.js"/>"use strict";var canvas;var engine; document.addEventListener("DOMContentLoaded", startBabylonJS, false); function startBabylonJS() { if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var createScene = function () { var scene = new BABYLON.Scene(engine); //Camera Setting var camera = new BABYLON.FreeCamera("freeCam", new BABYLON.Vector3(0,3,-10),scene); camera.checkCollisions = true; camera.applyGravity = true; //Adding point light var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 10), scene); // Directional Light var dirLight = new BABYLON.DirectionalLight("directionalLight", new BABYLON.Vector3(-1, -2, -1), scene); dirLight.position = new BABYLON.Vector3(120, 40, 20); dirLight.intensity = 0.5; //Create box var box = BABYLON.Mesh.CreateBox("cube",2,scene); box.position.y += 2; box.checkCollisions = true; //Create ground var ground = BABYLON.Mesh.CreateGround("floor",200,200,12,scene); ground.checkCollisions = true // Move the light with the camera scene.registerBeforeRender(function () { dirlight.position = camera.position; light.position = camera.position; }); //Attach Control if(scene.activeCamera){ scene.activeCamera.attachControl(canvas); } //Key Control if (scene.activeCamera.keysUp) { scene.activeCamera.keysUp.push(90); // Z scene.activeCamera.keysUp.push(87); // W scene.activeCamera.keysDown.push(83); // S scene.activeCamera.keysLeft.push(65); // A scene.activeCamera.keysLeft.push(81); // Q scene.activeCamera.keysRight.push(69); // E scene.activeCamera.keysRight.push(68); // D } return scene; }; var scene = createScene(); engine.runRenderLoop(function () { scene.render(); }); }} Is there something wrong in my code? I have also attached some images for better understanding. Thanks, Somnath
- 2 replies
-
- babylon
- freecamera
-
(and 4 more)
Tagged with:
-
Would like to port my HTML5 arcade game which uses arrows for player navigation and space key to shoot, to Android via XDK. I had success with this basic demo, built .apk with XDK and installed on my 'Droid, showing the coordinates of a rectangle using touch. So that's a start. But how are you guys implementing player navigation and shooting? Is there a doc/tutorial? This dev has a controller library on github—that's all I'm finding. Thanks in advance for direction.