Search the Community

Showing results for tags 'Box'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 18 results

  1. When creating a Box using BABYLON.MeshBuilder.CreateBox() I can pass it parameters like width, height and depth, but I don't see widthSegments, or heightSegments for example. Is there a way to do that?
  2. I have a tilemap, like this: The tile number 47 in reality is a 64x15 Thorn, I want to know how do I change the size of the collision box him just to be 64x15 and not 64 x 64. EDIT: Put all code attached. Thank you in advance. phaser.tar.gz
  3. How should i create the box mesh to use as a trigger zone... I really want a non-visible box area to walk thru and trigger and event. I get that i can use the action manager and or just check intersects with in update loop. But i can trying to add support for trigger volumes to my BabylonsJS Toolkit and i am creating the box using the babylon.entities api in C#. So i guess what i an asking is 'HOW MUCH' of a regular cube mesh do i need to create for it to be a non-visible at runtime area that still has some kind of geometry that defines that actual area of the box that 'lives' so the mesh.intersect api works. Right now i am making just a normal mesh box and if it is a 'trigger a volume' i just set set the babylonMesh.visibility = 0 and babylonMesh.isVisible = false then just DONT create the mesh materials for it by skipping the if (render != null) section that does all that good stuff. Now is that how i should create an area box? Just make a normal box and set its visible = false... ? Or What ??? Thanks for the info
  4. Hi folks, My first post on the forum, so hello all! I'm been playing around with babylonjs. My intention is to make a Red Alert style game, mostly just to improve my JS skills, and learn the basic concepts of game development etc. However I've struggled to find a best approach for moving meshes around a ground plane. I'm essentially trying to animate a block to move from a selected mesh's initial point, to a selected point. But the movements happen immediately, and feel 'buggy' in my example: Any help much appreciated! Cheers, Ewan
  5. I'm trying to have 1 face of a box display a 2D animation. The idea would be the same as having it display a texture like in the link below, only an animation instead. How should I go about achieving it?
  6. Hello I'm beginner in BabylonJS I would link two cube with a "BABYLON.Mesh.CreateLines " but when moving a cube or two I would like the link remains attached to the cubes . Thx and have a good day !
  7. can anyone check this steps to reproduce : 1st rotate around X then rotate aroung Y if you notice the color or another Box is changed cay anyone tell me why please help me I'm new hear
  8. Hi, I just started learning babylonjs i have some doubts please help me I am simply making a rubix cube using MeshBox, i just simply want to rotate each block as you know what we did in Rubix Cube now my problem if i use animation for rotating 90 degree like this animationBoxY = new BABYLON.Animation("myAnimation", "rotation.y", 160, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); animationBoxX = new BABYLON.Animation("myAnimation", "rotation.x", 160, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keys = []; keys.push({ frame : 0, value : 0 }); keys.push({ frame : 100, value : Math.PI/2 }); animationBoxY.setKeys(keys); animationBoxX.setKeys(keys); window.addEventListener("keydown", handleKeyDown, false); function handleKeyDown(evt){ if (evt.keyCode==65){ Box1.animations.push(animationBoxY); scene.beginAnimation(Box1, 0, 400, true); } if (evt.keyCode==68){ Box1Copy.animations.push(animationBoxX); scene.beginAnimation(Box1Copy, 0, 110, true); } by doing this i had two problem 1. hear both the animation got combined means it's moving diagonally instead of particularly X or Y 2. if i animate in x then y so animation for y is starting with from start not the position where it was last(hope you got what I'm saying) i also tried rotation like this box1.position.x = -2; but this is not auto rotation i want that when i press a key it will rotate 90/-90 degree like in rubix cube Please help me I'm pretty new hear
  9. When creating a box, there's the assumption that all sides are of equal length. However, for a rubberband selection in an RTS I'd like to create a rectangular box on the fly (from the screen down to the ground) and then check intersections with all units on the screen to select them. How could I create a rectangular box, or is there even a better way to do rubberband selection in BabylonJS?
  10. Hello everybody, here is my new and first game launched on Google Play, it's called "Da Box"! URL: It's a puzzle/platformer, using one finger to play. It's really easy to learn, but somehow hard to master! It was made using Construct 2 (for the most part, some coding was done for additionnal stuff) and it uses the Crosswalk Webview for the best compatibility. I hope you'll like it, and don't hesitate to comment, give me suggestions/feedback and share! Enjoy Here are some screenshots:
  11. Hi, Just wanting some guidance here... I'm new to 3D Web development and Babylon I'm wanting to create a 'room' with objects in it with the arc camera. The room is shaped as a simple 3D rectangle (as you would expect a room to be). When the user looks at the room from a short distance, I'm wanting the walls to be transparent (so the user can see inside the room), however the walls at the very back to be visible. When the camera spins around the room (180 degrees for example), the same thing is to apply. Similarly with the floor and the roof by moving up and down. How can I achieve this? I was thinking of creating the 6 'planes' manually, and then using some maths to set the transparency of each plane individually depending on where the camera is positioned (is this even possible?). Or, is there a type of Mesh best suited to do this? Do i need to turn back culling off? I wasn't able to find anything on this hence my question. Any help would be greatly appreciated.... Thanks, bws.
  12. Hi, setting the "checkCollisions" property to true on a box works well (*) when you're outside the box : But what if you're inside the box ? It looks like you can pass through the box (from inside to outside) : Is there a way to prevent this ? I'm thinking about using 6 panes instead of a cube, but there might be another solution. * Except you can see through the box.
  13. 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
  14. Hi guys, This is my example: What do you think? Regards, Nicholls
  15. Hello everyone. I'm new to Phaser, and believe it or not, the first thing I decided to do, was a 2D fighting game. first of all, i'm spanish, so excuse me for my english. I thought it would be an awesome experience, but the real thing is that I've got so many problems with it that I can't do nearly anything. I'm using Phaser for programming it. One of my mayor problems are the collisions. I use spritesheets for the characters, and like in many fighting games, some sprites are smaller than others. (the one for crouching is smaller than the Idle one). the problem is, that when I want to crouch by pressing a key, the sprite makes it's animation, but the collision box does not adjust the sprite height. at the moment, i've got this: In a "preloader.js" file, with many other different resources, I've got this line. this.load.spritesheet('herbal', 'imagenes/spriteSheetHerbal.png', 202, 222); In it, I'm sending a width (202) and a height (222) value for every sprite in the spritesheet. I KNOW that in this way, my game does not adjust the width or height like it should (because it takes the width and height for every sprite) My first question here is: 1- Is there any other way for loading spritesheets without telling an exact width or height? I'm using the arcade physics for the game. I'm using them because it's the only physics system i understand a little bit from the 3 of them. So, my second question is: 2- For a fighting game... which physics system should I use? NINJA, P2 or ARCADE? What are the first 2 for? (I really have no clue of them. I've read some information, but still don't understand). In another script called "batalla.js", I make the following: this.jugador=this.add.sprite( - 300, - 115, 'herbal'); this.jugador.anchor.setTo(.5, .5); this.physics.enable(this.jugador, Phaser.Physics.ARCADE); this.jugador.scale.x= 1; this.jugador.animations.add('stand', [2, 3, 4, 5, 6, 7, 8, 9], 8, true);this.jugador.animations.add('down', [0], 8, true);this.jugador.animations.add('defense', [1], 8, true);this.jugador.animations.add('walk', [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28], 8, true);this.jugador.animations.add('backwalk', [27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 10], 8, true); As you can see, I asing the spritesheet to a variable called "jugador" and then I start the physic system. finally, I create the animations with every sprite. the result of this is that every sprite has the same width and height, and it doesn't matter if I crouch or not, the sprite will have the same height and width. I've tried the "setSize()" method, and I've tried to make the collision box smaller by putting it in the update function, and it allows me to crouch, but when I again try to get up, the collision box, makes bugger again, and it fells from the stage, so, that way is not the best for me. Now that I've exposed my entire situation, I would like to ask again...How can I adjust the width and height dinamycally in order to make the game playable? Thank you all for your patience. I attach 1 screenshoot for you to see.
  16. Hey guys, I've just noticed that the bounding box of a plane in the debug layer and the bounding box which is taken into account when computing mesh intersection with a point are inconsistent. Here is the playground example (just check the bounding boxes checkbox). So one of them should be fixed... Upd: Another problem is when the plane's bounding box does fit the bounding box of debug layer, there is no intersection at all (that's an obvious problem because of plane thickness I think). Here is the playground sample. Maybe the solution is to give a minimal bounding box thickness of BABYLON.Epsilon.
  17. there is any instruction to set the bounding box to an entire group of sprites? I have the following: n_bullets =; n_bullets.enableBody = true; n_bullets.physicsBodyType = Phaser.Physics.ARCADE; n_bullets.createMultiple(10, 'n_bullet'); n_bullets.setAll('anchor.x', 0.5); n_bullets.setAll('anchor.y', 1); n_bullets.setAll('outOfBoundsKill', true); n_bullets.setAll('checkWorldBounds', true);I think setsize method donĀ“t exist for group .
  18. Hello, I started a small sandbox game with Phaser and I have this problem. I can rotate the car, but collision box does not rotate. I don't understand how to rotate both of them :/ I attached the screenshot and code is here: How to rotate the collision box together with the sprite?