Jump to content

Search the Community

Showing results for tags 'distance'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • 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 12 results

  1. suppose you have two different lines: game.physics.arcade.overlap(pl, bat, function(sp, sp2) {sp2.kill()}) and if (game.physics.arcade.distanceBetween(pl, bat) < 222) {bat.kill()} the top detects when the player touches a randomly placed bat in a group and kills it, the second detects when the player is in RANGE of a randomly placed bat in a group and kills it. the problem is the second one doesn't work. i'm essentially looking for a way to merge these two so that the bat in line 2 dies the way the one in line 1 does. this doesn't seem to work either: if (game.physics
  2. I have recently run into a problem with the physics joints in Babylon. I add a distance joint between two impostors in my scene, but after some time, I would like to remove that joint. Currently on the docs, there is no reference to a removeJoint function, and after looking into some of Babylon's source code, I found the function link: https://github.com/BabylonJS/Babylon.js/blob/master/src/Physics/babylon.physicsEngine.ts However, the function appears as if it is not complete, and I am unsure of the proper way to access it. Is there a way to properly remove a physics joint?
  3. Hi, I need some help for Vector calculation... Here is a playground. I'm looking for the position between the camera and a mesh, but at a fixed distance before the mesh... Many thanks !!
  4. Is there a way to control the distance or zooming of the reflected image. Check the two screen shots... Look at the mountains and scenery reflected in the larger sphere. The fist shot is from unity and it SHOW MORE of the reflected scenery behind... The second shot is my babylon but the reflected images are MUCH closer or ZOOMED in more so you see LESS of the reflected scenery in sphere... How can I control the ZOOM or reflected image distances ??? First Shot (Unity Rendered): Second Shot (Babylon Render) And Notice the difference in the ZOOM factor of the
  5. Hello guys... Got another tough one form me, hopefully someone can help. I am making a component for the BabylonJS toolkit to support LODGroup... to automatically build LOD support for meshes. In unity, when setting up a LODGroup... the levels are specified in percent: The documentations says "The percentages in the LOD bars represent the fraction of the view frustum depth where that LOD level becomes active. But in Babylon we apparently use actual distance values to setup LOD... My question is how can I convert these percentage values to distance to mesh.addLODLe
  6. Hey. Was planning to do something big with babylon, but realized that chrome has got some problem with using all the computer's specifications, and may lag twice as much than a normal appliaction, so I wanted to kow how to (if you can) modify the render distance. thanks.
  7. There is a player and some obstacles. The obstacles are some random rectangles. The task is to get the distance between the player and the nearest object in front of him. To do so I create lineOfSight in render method. My idea is to find its intersections with the lines forming the boxes, that float around. The problem is that I can't find the coords of the vertices of the boxes, as long as they are rotated. So there are basically two questions: how to find the vertices of the objects? is it a way to go? I mean, maybe there are some better approaches to this task.
  8. Hi I need to find the distance between a player sprite and the closest sprite to it in a group of sprites, I know this can be done by iterating through each of the sprites in the group and checking them individually however, I was hoping phaser had a built in way of accomplishing this. Once the player is within a certain distance, it will die so if phaser has an event for this that will work as well. Thanks for any help
  9. Hey guys I am trying to figure something out. I have a scene with a handful of identically sized boxes that can be moved around and rotated independently. When I move a box I can check which other box is closest to it and whether it is "in range" (ie distance is less than a set value) by checking distance between currentBox.position and each boxes.position. If they are in range then I can highlight it somehow (currently I set .visibility on both boxes to 0.5). This works quite well. When boxes are moved out of range again they become unhighlighted (ie .visibility=1 is set to 1);
  10. I want to calculate a distance between object of the platformer and a place it can possibly achieve without moving up or down (face the obstacle or fall down), just left or right. So I use test bodies called this.shadowSide (to watch wall facing) and this.shadowDown (to watch falling). Prefer to call them "shadow bodies". I use this.game.physics.arcade.overlap to determine if the shadow body overlaps the floor. I move shadow bodies (left or right, depending of the direction I need), check overlaps and either continue searching or return a distance. It works well for sprite floors. The trouble
  11. Hi guys, do you know what's the best solution for a well performed game with automatically increasing game score and distance like other endless scroller? I've two different ways tested. In reality, the code looks something different. I do not know memorize everything. The important part is the function calling. In update game loop or with different timer parallel... 1. - Update distance every time in game loop (update()). 60 times, every second, the player moves a few px. This is a value between 0.3 and > 2, depending on the game speed. - Update score every time in game loop (update
  12. Hei Phaser-Folks, finally I had to register and now I really would like starting asking questions I've been playing around with Phaser for like a month and came to a point today where I could need some help. Here is the problem: I have a checker board and two different groups of figures (let's say black and white). Now I want to check if any of those figures is surrounded by four other figures of the other group, like one black is surrounded by one white (left, right, up and down). Since I have them in a group I cannot do a simple distance check like if white.x - black.x < x1 do... I
  • Create New...