When a creature is declared as a blocker, the attacking creature gains the status of 'blocked' (CR 509.1h). Crucially, a creature remains blocked for the rest of combat even if all blocking creatures are removed from combat before the damage step (CR 509.1h, 702.2c).
This means that under normal circumstances, a blocked creature with trample cannot trample over to the defending player just because its blockers were killed — it is still considered 'blocked' and must assign lethal damage to its (now-absent) blockers first, with any excess going nowhere, resulting in 0 damage to the player.
However, if the blockers are removed before they are declared as blockers — meaning during the declare attackers step or before the declare blockers step — the attacking creature was never blocked in the first place. In that case, it is an unblocked attacker and deals all its damage directly to the player, trample or not.
Concrete example: Your 5/5 trample creature attacks. Your opponent blocks with a 2/2. In response to nothing (before damage), your opponent kills their own 2/2 with an instant. Your 5/5 is still 'blocked' — with trample, it must assign 0 (lethal to a dead creature) and the remaining 5 damage goes to the player. Wait — actually lethal damage to the 2/2 is 2, so it assigns 2 to the 2/2 and 3 tramples to the player. Without trample, all 5 would be stuck on the blocked creature dealing 0 to the player.
So trample does matter here (CR 702.19b): you assign lethal damage to each blocker (even a dead one, using its toughness as the threshold), and excess damage hits the player. If blockers never existed (never declared), the creature is simply unblocked and deals full damage regardless of trample.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.