Problems passing
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Problems passing between blocks (Bump.lua)
Quite simply decrease the hitbox size of the player.
Re: Problems passing between blocks (Bump.lua)
lj
Last edited by ykirito on Sun Nov 26, 2017 3:40 pm, edited 1 time in total.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Problems passing between blocks (Bump.lua)
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°)
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°)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Problems passing between blocks (Bump.lua)
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
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
Who is online
Users browsing this forum: Semrush [Bot] and 2 guests