Workshop › Mario-style Platformer › Step 15 of 37
Rising into a tile, the head went into the tile above: put the head exactly at that tile's bottom. vy = 0 then lets
gravity pull the body back down.
```js
} else {
body.y = Math.floor(body.y / TILE) * TILE + TILE
}
```Math.floor(y / TILE) is the row the head went into; times TILE plus TILE is that tile's bottom edge.In moveY, after the if (body.vy > 0) { ... } block, add the else block before body.vy = 0.
Skills: Collision detection