Skip to content

Commit

Permalink
use overlapCallback for overlap named methods
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-calleja committed Mar 4, 2025
1 parent 623382c commit f0bc67c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/physics/arcade/ArcadePhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ var ArcadePhysics = new Class({
* @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check.
* @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`.
* @param {*} [callbackContext] - The context in which to run the callbacks.
*
* @return {boolean} True if at least one Game Object overlaps another.
Expand Down Expand Up @@ -338,15 +338,15 @@ var ArcadePhysics = new Class({
*
* @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.
* @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `overlapCallback` will only be called if this callback returns `true`.
* @param {any} [callbackContext] - The context in which to run the callbacks.
*
* @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.
*/
overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext)
overlapTiles: function (sprite, tiles, overlapCallback, processCallback, callbackContext)
{
return this.world.overlapTiles(sprite, tiles, collideCallback, processCallback, callbackContext);
return this.world.overlapTiles(sprite, tiles, overlapCallback, processCallback, callbackContext);
},

/**
Expand Down
6 changes: 3 additions & 3 deletions src/physics/arcade/World.js
Original file line number Diff line number Diff line change
Expand Up @@ -2254,13 +2254,13 @@ var World = new Class({
*
* @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.
* @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap.
* @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `overlapCallback` will only be called if this callback returns `true`.
* @param {any} [callbackContext] - The context in which to run the callbacks.
*
* @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.
*/
overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext)
overlapTiles: function (sprite, tiles, overlapCallback, processCallback, callbackContext)
{
if (tiles.length === 0 || (sprite.body && !sprite.body.enable) || (sprite.isBody && !sprite.enable))
{
Expand Down

0 comments on commit f0bc67c

Please sign in to comment.