Search the Community
Showing results for tags 'javasript'.
-
Nothing..
- 2 replies
-
- videogames
- animations
-
(and 2 more)
Tagged with:
-
Hi coders, I have a JSON data coming through some API. This data is List of objects. For example... [{ "rackid": "rack_1", "components": { "cpu_nodes": [ { "name": "cn1", "state": "idle", "power_status": "Up" }, { "name": "cn2", "state": "idle", "power_status": "Up" }, { "name": "cn3", "state": "idle", "power_status": "Up" }, { "name": "cn4", "state": "idle", "power_status": "Up" } ], "service_nodes": 2, "login_nodes": 1, "master_nodes": 2 } }] This could have any number of objects in the list. And also I have models ready for each components in incoming data as .babylon. Now I want to render the meshes using above data. For this will require to call BABYLON.SceneLoader.ImportMesh() inside a for loop. But it's not working for me what can I do?
-
Hi all, I am trying to create a platformer which allows the player to wall jump however I'm struggling to figure it out. I am using the player movement code from the example here: https://phaser.io/examples/v2/games/starstruck. I done some looking around and only found this example which moves the player automatically which I don't want and the code is more suited to that type of mechanic: https://www.emanueleferonato.com/2018/04/28/super-mario-who-html5-platformer-prototype-inspired-by-ios-hit-yeah-bunny-thanks-to-phaser-and-arcade-physics-updated-to-phaser-3-6-0/ Any suggestions on how I could tackle the issue of finding a wall, attaching the player to it and jump to another wall while using the controls of the first example would be appreciated, Thanks
-
So i am trying to orbit a small sphere around a bigger sphere like so: var orbit = new Sprite(loader.resources.RedB.texture); stage.addChild(orbit); orbit.anchor.set(0.1, 0.1); orbit.position.x= Gball.x*1.3; orbit.position.y = Gball.y/3; orbit.scale.set(0.15, 0.15); Gball.addChild(orbit); animate(); function animate() { requestAnimationFrame(animate); // just for fun, let's rotate mr Honeypot a little Gball.rotation -= 0.05; // render the container renderer.render(stage); } now the only problem is that when i click on the button to remove the child, but want him to keep the position he had in the animation: var ballX = orbit.x; var ballY = orbit.y; document.getElementById("bot").addEventListener("click", function () { var orbit = new Sprite(loader.resources.RedB.texture); stage.addChild(orbit); orbit.anchor.set(0.1, 0.1); orbit.position.x= ballX; orbit.position.y = ballY; orbit.scale.set(0.15, 0.15); Gball.removeChild(orbit); return false; }); does anyone know how i might be able to do that?