Tile collision sounds like an implementation detail and is the difference between a platformer that works and one that occasionally drops you through the floor for no visible reason. This guide covers how it is done here and what it means when you are playing Pixel Fantasy Adventure.
Why the order matters
A character moving diagonally can end a frame overlapping both a wall and a floor. The engine has to push them out of both, and the order it chooses decides what happens.
Resolving horizontally first means a player walking into a wall at the exact moment they land can be pushed sideways into the floor tile and then pushed down out of it - straight through the ground. It is the classic tile-collision bug, it happens rarely, and it is impossible for a player to diagnose or forgive.
Resolving vertically first eliminates it. The character is placed on top of the floor, and only then pushed out of the wall, which is always a sideways movement along a surface they are already standing on.
This is why landings in the tight vertical shafts of Pixel Fantasy Adventure's later screens are reliable even though you are frequently touching a wall and a floor in the same frame.
How a one-way platform is implemented
A one-way platform is solid only when three conditions hold: you are falling rather than rising, your feet are at or just below its top edge, and you were above that edge in the previous frame.
That last condition is the important one. Without it, a character jumping up through a platform would be caught by it on the way through as soon as their upward velocity turned into downward velocity.
The practical result is exactly what a player expects: you land on them from above and pass through them from below, with no special input.
Ad space reserved. See README.md to connect an ad unit.
What this enables in level design
Vertical shafts that work in both directions. A route that appears blocked by a ceiling frequently is not, which makes a tile level feel larger than its dimensions.
Layered rooms, where the same horizontal space is used at two or three heights and a player moves between them without a dedicated route.
And recovery. Falling in a level made of one-way platforms usually means landing on something two tiers down rather than at the bottom, which keeps a mistake proportionate.
Telling the two apart at a glance
A solid block is drawn as a full tile with shading along the top and a darker band along the bottom. A one-way platform is drawn as a narrow bar occupying the top quarter of its tile, with a lit edge and visible empty space beneath.
The difference is deliberately large, because trial and error is an expensive way to learn a rule in a game with three lives across six screens.
Spikes get their own treatment - a row of crimson triangles - and the crimson outline convention means they read as dangerous even at a glance.
Why tile grids are worth using at all
A 32-pixel grid sounds like a restriction and buys three things that matter more than the freedom it costs.
Levels become editable as text. Pixel Fantasy Adventure's six screens are written as rows of characters - a hash for a solid block, a caret for spikes, an equals sign for a one-way platform - which means a level can be read, reasoned about and changed without a tool.
Collision becomes cheap and exact. Testing a character against a grid is a handful of array lookups rather than a sweep against a list of arbitrary shapes, and the result is the same every frame.
And the level becomes legible to the player. Everything lines up, so a gap is obviously one tile or two tiles rather than an amount you have to judge, and a jump you made once you can make again.
The limits of a grid
Grids cannot express slopes, which is why Rolling Knight uses a continuous height field instead and why the two games feel nothing alike.
They also encourage a particular rhythm - everything at multiples of the same distance - which can become monotonous across a long game. Pixel Fantasy Adventure works around this by varying the density of its screens rather than the grid: The Undercroft is a wide open floor, The Flooded Hall is a vertical weave, and The Sky Vault removes the floor almost entirely.
The third limit is that a grid makes precise gaps impossible. Every gap is a whole number of tiles, so the difficulty comes from arrangement and enemy placement rather than from a jump being marginal - which is arguably a feature in a game with three lives across six screens.
Moving well in a tile level
Check ceilings before routing around them. In any vertical section, the question 'is that solid or thin' has a visual answer and it is worth asking.
Use the stomp as movement. Landing on a creature from above defeats it, bounces you to about three quarters of a jump, and refreshes your jump - which means a chain of two or three stomps is frequently the fastest route through a screen.
And treat spikes as walls rather than as floors. They occupy the bottom of their tile with clear space above, so a platform above a spike row is usually reachable and usually the intended route.
Key takeaways
- Tile collision resolves vertically before horizontally, which prevents the classic fall-through-the-floor bug.
- A one-way platform is solid only when you are falling and were above it last frame.
- One-way platforms make vertical shafts traversable in both directions, so blocked routes often are not.
- Solid blocks are full tiles; one-way platforms are narrow bars with space beneath.
- Stomping refreshes your jump, so two or three in a chain is often the fastest route.
- Spikes sit at the bottom of their tile, so a platform above a spike row is usually the intended route.
Frequently asked questions
Why do some platforms let me jump through them?
They are one-way platforms: solid only when you are falling onto them from above. They are drawn as narrow bars with empty space beneath, unlike solid full-tile blocks.
Why does collision order matter?
Resolving horizontally first can push a character who lands while touching a wall straight through the floor. Resolving vertically first makes landings reliable.
How do I get past a ceiling in Pixel Fantasy Adventure?
Check whether it is a solid block or a thin one-way platform. If it is thin, you can jump straight up through it.
Is stomping better than attacking?
Usually. It scores nearly twice as much, bounces you, and refreshes your jump, which makes it a movement tool as well as an attack.
Can I stand on spikes safely if I am careful?
No. Spikes cost a life on contact. They sit at the bottom of their tile, so the space above them is clear and usually where the route goes.