I am trying to recreate an old DOS game and doing scaling on tilemaps and sprites to create appropriate low-res visuals. Both the map layer and the sprite have their scale set to (4,2), and this causes the physics.arcade.collide(player,mapLayer) check to fail- collisions are not found. It boils down to an intersection test in Phaser.Tile where the unscaled tile rect is compared with scaled body rect (relevant section below).
I have also tried just setting world scale and not the individual layer/sprite scales. This also fails, but in a different location.
Phaser.Tile:
intersects: function (x, y, right, bottom) {
if (right <= this.worldX) // right is SCALED body position, worldX is UNSCALED tile position
{
return false;
}
if (bottom <= this.worldY)
{
return false;
}
if (x >= this.worldX + this.width)
{
return false;
}
if (y >= this.worldY + this.height)
{
return false;
}
return true;
},
I am trying to recreate an old DOS game and doing scaling on tilemaps and sprites to create appropriate low-res visuals. Both the map layer and the sprite have their scale set to (4,2), and this causes the physics.arcade.collide(player,mapLayer) check to fail- collisions are not found. It boils down to an intersection test in Phaser.Tile where the unscaled tile rect is compared with scaled body rect (relevant section below). I have also tried just setting world scale and not the individual layer/sprite scales. This also fails, but in a different location.
Phaser.Tile: