mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 19:43:28 +00:00
1 line
18 KiB
JSON
1 line
18 KiB
JSON
|
{"class":{"name":"Phaser.Physics.Ninja","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"reference to the current game instance.","optional":false,"default":null}],"help":"Ninja Physics. The Ninja Physics system was created in Flash by Metanet Software and ported to JavaScript by Richard Davey.\\n\\nIt allows for AABB and Circle to Tile collision. Tiles can be any of 34 different types, including slopes, convex and concave shapes.\\n\\nIt does what it does very well, but is ripe for expansion and optimisation. Here are some features that I'd love to see the community add:\\n\\n* AABB to AABB collision\\n* AABB to Circle collision\\n* AABB and Circle 'immovable' property support\\n* n-way collision, so an AABB\/Circle could pass through a tile from below and land upon it.\\n* QuadTree or spatial grid for faster Body vs. Tile Group look-ups.\\n* Optimise the internal vector math and reduce the quantity of temporary vars created.\\n* Expand Gravity and Bounce to allow for separate x\/y axis values.\\n* Support Bodies linked to Sprites that don't have anchor set to 0.5\\n\\nFeel free to attempt any of the above and submit a Pull Request with your code! Be sure to include test cases proving they work."},"consts":[],"methods":{"public":[{"name":"clearTilemapLayerBodies","static":false,"returns":null,"help":"Clears all physics bodies from the given TilemapLayer that were created with `World.convertTilemap`.","line":231,"public":true,"protected":false,"private":false,"parameters":[{"name":"map","type":["Phaser.Tilemap"],"help":"The Tilemap to get the map data from.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to map.currentLayer.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"collide","static":false,"returns":null,"help":"Checks for collision between two game objects. You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap Layer or Group vs. Tilemap Layer collisions.\\nThe second parameter can be an array of objects, of differing types.\\nThe objects are also automatically separated. If you don't require separation then use ArcadePhysics.overlap instead.\\nAn optional processCallback can be provided. If given this function will be called when two sprites are found to be colliding. It is called before any separation takes place,\\ngiving you the chance to perform additional checks. If the function returns true then the collision and separation is carried out. If it returns false it is skipped.\\nThe collideCallback is an optional function that is only called if two sprites collide. If a processCallback has been set then it needs to return true for collideCallback to be called.","line":346,"public":true,"protected":false,"private":false,"parameters":[{"name":"object1","type":["Phaser.Sprite","Phaser.Group","Phaser.Particles.Emitter","Phaser.TilemapLayer"],"help":"The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.TilemapLayer.","optional":false,"default":null},{"name":"object2","type":["Phaser.Sprite","Phaser.Group","Phaser.Particles.Emitter","Phaser.TilemapLayer","array"],"help":"The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.TilemapLayer.","optional":false,"default":null},{"name":"collideCallback","type":["function"],"help":"An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them.","optional":true,"default":"null"},{"name":"processCallback","type":["function"],"help":"A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them.","optional":true,"
|