Search the Community
Showing results for tags 'overlapping'.
-
Hi, I have some meshes, created with PolygonMeshBuilder. They're not overlapping, but their bounding boxes are as you can see in the attached screenshot. I want to achieve pixel perfect picking for those. Using scene.pick without fastcheck for some reason still picks those meshes by bounding box. (In the attached screenshot - the green mesh is getting picked instead of the purple one) Any ideas? Thanks
-
Hello fellow phaser users I have been playing around a bit with tiled to make my 2D maps for a phaser game. But I have 2 problems that I cant seem to find the answer to : I made myself a script that a pokemon appears if I run on a specific layer. But I'm a bit stuck it keeps on finding pokemons because it keeps on saying that i'm in touch with the layer. var pokemonwild = game.physics.arcade.overlap(player, layerbackground); console.log(pokemonwild) This is what I am using right now. What should I add so it only checks once for an overlap each time I move? Also a small problem I cant get solved in tiled I made a layer named " frontgroundLayer" as purpose that it has to hide the player if it runs into that layer. For exmaple if the player runs into long grass you will see the long grass instead of the player. I have no problems with making them collide I just cant seem to find a way for the player to hide behind a tree for example. Thanks for the read hopefully anyway can help me Kind regards
-
Hello, I want to create game in 16:9 ratio, but my actual clickable area would be 4:3 ratio (the rest is GUI). I'm setting background color to blue using game.stage.backgroundColor BUT I would like to have my clickable area in different color, for example red. I know I can just put some image on that blue background, or draw some rectangle, but I'm thinking about the best approach looking at performance as well as assets weight. Any ideas?
- 1 reply
-
- backgrounds
- overlap
-
(and 1 more)
Tagged with:
-
Hi there, first of all: excuse my english I am a newcomer in the world of phaser but I'm quite addicted. After some tutorials I'm making my first steps with trail'n error. Right now I'm looking for a solution for this problem: I've got a player and a object (a table for example). It's that classical 2D RPG/Adventure setting so the player should collide with the object, but doesn't stop with his head on the bottom of the object. Instead he should overlap with a part of his body. From that behaviour: to that: After an hour of vainly internet reaseach I hope you guys can help me out. I'm using the Arcade Physics and think I have to operate with customSeparateY. Right now my player collides on the left and right side of the object but can walk through from the bottom and above. That's my create: create: function () { object = game.add.sprite(100, 150, 'object'); object.frame = 2; player = game.add.sprite(200, 200, 'player'); game.physics.arcade.enable(player); game.physics.arcade.enable(object); player.body.collideWorldBounds = true; object.body.immovable = true; player.body.customSeparateY = true; }, And in the update function I check for collision between player and object: game.physics.arcade.collide(player, object); I found that physics.arcade.overlap method but at this moment I don't know how to use it correctly. Since I think there is some important stuff I don't see right now I'm looking for help. Thanks in advance
-
Hi everybody, I have two sprites, with physic enabled and I set the x velocity both, and they collide with the limite of game world without problem and without overlapping if they are in the same x line. But If they collide with a tilemap, the first sprite is ok, but the next when arrive with the first sprite... it's overlapping with the first. I'm using ARCADE physic and Phaser, the last version, v2.0.5 I don't have the code right now but I remember that: //In creategame.physics.startSystem(Phaser.Physics.ARCADE); map = game.add.tilemap('level1');map.addTilesetImage('mindout-level1', 'tiles');map.setCollision(1);layer = map.createLayer('level1');layer.resizeWorld(); box1 = game.add.sprite(100, 500, 'box1');game.physics.enable(box1);player.body.collideWorldBounds = true; box2 = game.add.sprite(100, 500, 'box2');game.physics.enable(box2);box2.body.collideWorldBounds = true; //In the updaet codegame.physics.arcade.collide(box1, layer);game.physics.arcade.collide(box2, layer); game.physics.arcade.collide(box1, box2); What I miss with the layer? Thanks!