I have a platfomer with a constant acceleration built in to simulate gravity:
let playerGravity = 0.2;
playerSprite.vy += playerGravity;
collision detection for playerSprite and array of sprites that are allowed to collide with the playerSprite:
if( b.hitTestRectangle(playerSprite, collSprites[i])){
b.rectangleCollision(playerSprite, collSprites[i], false);
where:
b = new Bump(PIXI);
on "impact" where playerSprite lands on top of a tile with which it can collide first aligns the playerSprite to the tile, then after ~1 second @ 60fps, the playerSprite disappears. Movement is also hindered after collision to whole tiles before playerSprite disappears.