Jump to content

Search the Community

Showing results for tags 'point'.

  • 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
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 16 results

  1. http://babylonjs-playground.com/#RC9CZ Hello, I'm currently developing a small game and need to rotate a mesh to a point. I want to set the rotation of a mesh to face a specific point in the "3D-Room". I hope anyone can get this cylinder in the playground to face to (0|0|0). Thanks a lot, Josh
  2. for (let i = 1; i < xPoints.length-1; i++){ a= i*2 this.game.add.tween(graphicsend.currentPath.shape._points).to({a: (225-newypoint[i]) }, 500, Phaser.Easing.Linear.None, true); } for (let i = 1; i < yPoints.length-1; i++){ b= i*2 +1 this.game.add.tween(graphicsend.currentPath.shape._points).to({b: (315-newxpoint[i]) }, 500, Phaser.Easing.Linear.None, true); } Hi, I am trying to tween the points of a graphic but I am having trouble looping it. The a and b variable I set is useless but if I set it to for (let i = 1; i < xPoints.length-1; i++){ a= i*2 this.game.add.tween(graphicsend.currentPath.shape._points).to({2: (225-newypoint[i]) }, 500, Phaser.Easing.Linear.None, true); } for (let i = 1; i < yPoints.length-1; i++){ b= i*2 +1 this.game.add.tween(graphicsend.currentPath.shape._points).to({3: (315-newxpoint[i]) }, 500, Phaser.Easing.Linear.None, true); } it works. Is there any way to represent the numbers to be tweened?
  3. hi, anyone knows why changing the value of "pointSize" doesn't influence the size of points of a shaderMaterial? shaderMaterial.pointsCloud = true; shaderMaterial.pointSize = 10;
  4. Hello, I have searched a solution for a problem for long time and didn't found, if someone have some ideas I am taking all x) did someone know if it's possible to rotate a group of bodies around an anchor point, I set some bodies for invisble walls and my objective is to turn them around by 90° around an anchor point, I know It must be not very comprehensive so I set up an Image to explain myself. In the screen, I have 2 bodies and I want them to turn around the red dot what must be my anchor point, I know it's impossible in arcade so I tried in P2 physics and impossible to found any solution :/ Thanks for reading, feel free to leave a feedback
  5. I'm developing point&click quest adventure (something like Machinarium) I have a background, for example, like on the bkg1.ipg I want to define some zone where the character can move. Example on bkg1-marked.jpg. Reaching the end of the red zone the character should stop. Also, it would be great to have ability to make it with some pathfinding like f.e. there are stairs on the background image and the character stays somewhere else on the "first floor". Player clicks on top of the stairs and the character goes there, according to the zone where he can walk Does Phaser have any tools for that?
  6. Hi i want to make those little circles move to a certain random point and watch them moving how is it possible to do it ? here http://asciimulation.link/creatures/new project/ thx in advance
  7. Before I start, I'd like to mention that I did a forum search, all the topics related to origin point were discussing rotation. If any of the existing topics apply to what I'm trying to do, please let me know. With that said - I'd like to be able to set the origin point of a mesh, so that when moved or scaled, it'll be according to that origin point. e.g. at the moment it seems the origin point is (0,0,0), I'd like to set it to (0.5,0.5,0.5) - assuming numbers range from 0-1 and represent 0%-100%. I attached a sketch to illustrate the issue, the blue circle represents the origin point of the box. At the moment when I scale a mesh, the result is (1), I'd like to achieve (2).
  8. Hey Phaser people, I'm currently working on a 2d upperview point & click game, using Arcade physics. What I want to develop is a "smart movement" system, where if you click on a part of the map, your character shouldn't get stuck in obstacles, but pass around them. For now, I'm using tweens to move my character to the mouse position, which cancels the collision. Thus, it's a no go. this.game.input.onDown.add(this.movePlayer, this); movePlayer: function (pointer) { var time = 9.5; var duration = (this.distance(this.player.x, this.player.y, pointer.x, pointer.y) * time); this.tween = this.game.add.tween(this.player).to({ x: pointer.x, y: pointer.y }, duration, Phaser.Easing.Linear.None, true); } Any suggestions ? Thanks ! I've also attached a small screenshot/ drawing of what I strive to achieve.
  9. Hi, I'm starting out with pixi.js, and really liking it so far! One thing that has really been puzzling me, however, is how to work with points and the scene graph. Let's say I have a problem like this, with two containers, and objects within those containers that essentially need to interact across the scene graph. In theory, the problem is trivial, however what I'm not quite sure of is the 'PIXI way' of doing this. For example, what's the best way to get some arbitrary point and convert its position to a global one? How about getting a DisplayObject's global position? And is there an easy way to transform a point from one local coordinate system to another? I've looked at the functions toLocal and toGlobal but they don't seem to be working as I'd expect them to. The documentation seems very thin and without usage examples I'm struggling to see how to use them properly. Also, where do WorldTransform and all of these matrix-related methods come into play? I was of the impression that an object's transform in space could be fully qualified with its point, parent, scale and rotation values so I'm having trouble seeing where these matrix operations step into the picture. On a related note, I'm having trouble working with objects like PIXI.Point and PIXI.Rectangle. For example, say I wanted to make a helper function that adds two points. My first thought would be to do something like function add(p1, p2) { return new PIXI.Point(p1.x + p2.x, p1.y + p2.y); } but that's clearly not right, since it's making a heap allocation every time the function is called! In fact, anywhere I find myself working with points, I keep wanting to treat them as value types, and I am not seeing a good way to use these structures conveniently, passing to and from functions, without making constant allocations. If I could see an example of PIXI code that works with points in one of these ways, I think it would be really helpful. Thanks! Daniel
  10. Hi all, Having started with Phaser a few days ago, I can't find any example or documentation about raycasting. So, to explain what I'm after: For a simple platformer, I have a character that's shooting at enemies. But, I don't want the bullets to be objects (sprites), because of the fast speed (the collision check might fail). So I thought about using raycasting, and have the first enemy in the line of sight take damage. Or, in some case, every enemy in the line of sight (until a specific tile is hit, the end of the world is reached, or a specific distance). The ray is always horizontal, so that should help a bit. Also, the ray might not pass through the sprites center, as some sprites are larger, some smaller, or the enemy is moving up/down/jumping. I checked the "Tilemap Ray Cast" example, which is exactly what I'm trying to achieve, but it works with tiles, and I need it to work with objects (sprites). From the source code, http://docs.phaser.io/TilemapLayer.js.html#sunlight-1-line-384 , it loops through all the tiles and checks every coordinate. Taking reference from TilemapLayer.getRayCastTiles, I managed to get it correctly using this code: rayPoints = ray.coordinatesOnLine(15); //15 is because enemy sprites are 16px widefor(var i=0; i<enemies.length; i++){ if(enemies[i].inCamera && spriteContainsPoint(enemies[i]) ){ enemies[i].tint=0x00ff00; }else{ enemies[i].tint=0xffffff; }}function spriteContainsPoint(){ //function which checks if the coordinate is inside the body of the sprite}but I feel it is quite inneficient, as it loops through every enemy sprite and checks if it is inCamera and it's bounds. A more efficient way would be the other way around: check if there is a sprite at a given coordinate: rayPoints = ray.coordinatesOnLine(15); //15 is because enemy sprites are 16px widefor(var i=0; i<rayPoints.length; i++){ checkForSpritesAtPoint(rayPoints[i][0], rayPoints[i][1]);}function checkForSpritesAtPoint(x, y){ //return array of sprites at given point, without looping through all}This way I will also get the enemy sprites ordered by distance (closest to furthest). Can this be achieved (layers, physics, magic ...)? So, in short, what I need is a way to get every sprite that a line passes through, sorted by distance to the player (without checking all the enemies in the world, and every pixel they occupy). Any ideas?
  11. Hello, I understand that we can "zoom" into a displayObjectContainer using the 'scale' property. I currently have one large such container which contains all of my graphics. However, on increasing the scale point, the screen zooms into the top left corner of the screen (presumably some kind of anchor point?). Is there any way to have the screen scale towards a specific point or anchor? i.e Zooming into the cursor position for example. At the moment, the displayObjectContainer seems to have no anchor property. ie. (Can we achieve a 'zoom' into a specific x/y point?) or even just a decimal anchor point of some sort? Much appreciated, Jordan
  12. 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.
  13. Hi guys, Its posible to get the height of a heightmap given the X and Z coordinates? Here i show an image explaining what i want: Thanks in advance, Carlos R.
  14. Quick question: I want to update a sprite's P2 body force to equal a constant value in a given direction. With polar coordinates, that's easy: I just set the magnitude and direction to what I want. With phaser points though, the only function for setting a point's coordinates directly (Phaser.Point#set) only seems to support cartesian coordinates. Is there an easy way to set a Phaser point to a set of polar coordinates, without having to convert from polar to cartesian coordinates myself? (Cross-posted on StackOverflow)
  15. Is there a way to convert window.clientX / window.clientY to PIXI stage? I have this scenario: container.touchmove = container.mousemove = function(data){ currentPlayer.drawTo(data.getLocalPosition(container).x, data.getLocalPosition(container).y);}but I need to listen and input mouse coords from the whole window, as when the user is dragging outside the stage, it stops drawing. this is what I need: $(window).on('mousemove', function(ev){ var point = windowPointToPIXI ???? getLocalPosition(container); where point.x and point.y would be the same as the one from previous: data.getLocalPosition(container) Then I can call: currentPlayer.drawTo(point.x, point.y);});
  • Create New...