Page 1 of 1
Problems passing
Posted: Sat Nov 25, 2017 3:46 pm
by ykirito
iup
Re: Problems passing between blocks (Bump.lua)
Posted: Sat Nov 25, 2017 4:07 pm
by Tjakka5
Quite simply decrease the hitbox size of the player.
Re: Problems passing between blocks (Bump.lua)
Posted: Sat Nov 25, 2017 4:19 pm
by ykirito
lj
Re: Problems passing between blocks (Bump.lua)
Posted: Sat Nov 25, 2017 6:11 pm
by zorg
I feel like that's a cop-out solution, since in bomberman, you should not be able to move sideways in corridors, only along them.
The TG-16 (and DOS) version somehow detected if you were around a corner, and had some code to move your character a bit sideways so they'll end up exactly in the middle of a corridor always, after you left an intersection.
One solution could be to treat the player as a "diamond" shape with regards to collision, not an axis-aligned rectangle... (or AA-rect but rotated 45°)
Re: Problems passing between blocks (Bump.lua)
Posted: Sat Nov 25, 2017 7:58 pm
by eliddell
I think bump.lua is strictly axis-aligned boxes, so no diamond shapes without upgrading to HC. But what you probably need to do is slide the sprite along toward the nearest cross-corridor in the appropriate direction until it hits the perfectly-aligned spot and pops through.
The primitive method of doing this would be to divide each block into quarters and check which part of it is being collided with. Frex, if the sprite is hitting the top-left quarter of the block while trying to move right, you probably want to slide him up until he's aligned with the opening above the block. If the sprite is hitting two quarters of a block, the player is messing with you and the sprite can just stop dead instead of sliding. ;P