SuperTux / supertux

SuperTux source code
https://supertux.org
GNU General Public License v3.0
2.51k stars 487 forks source link

Tux spawns one block low underwater #2111

Open Zwatotem opened 2 years ago

Zwatotem commented 2 years ago

SuperTux version: 0.6.3 System information: irrelevant

Expected behavior

When I place a spawn object in a level I expect Tux to be placed exactly in that square.

Actual behavior

Tux is being spawned exactly one block lower.

Steps to reproduce actual behavior

Examine the attached level, especially placement of spawn point. It is not placed in a spike. Yet Tux spawns in a spike. You can also recreate this level yourself.

test-swim-right.zip

KelvinShadewing commented 2 years ago

I've noticed that the game also prints messages saying Tux is spawning in a solid when he starts out on land. I think the current implementation spawns him below the tile then moves him up until he's free. If that's the case, I think it should be this way: start him right on the tile, then check a little ways down to see if there's solid ground, if there is, move him down, then move back up until he's in empty space.