Problems passing

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
ykirito
Prole
Posts: 2
Joined: Sun Nov 19, 2017 9:31 pm

Problems passing

Post by ykirito »

iup
Last edited by ykirito on Sun Nov 26, 2017 3:40 pm, edited 4 times in total.
User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

Re: Problems passing between blocks (Bump.lua)

Post by Tjakka5 »

Quite simply decrease the hitbox size of the player.
ykirito
Prole
Posts: 2
Joined: Sun Nov 19, 2017 9:31 pm

Re: Problems passing between blocks (Bump.lua)

Post by ykirito »

lj
Last edited by ykirito on Sun Nov 26, 2017 3:40 pm, edited 1 time in total.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Problems passing between blocks (Bump.lua)

Post 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°)
Me and my stuff :3True 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.
eliddell
Prole
Posts: 20
Joined: Sat Dec 10, 2016 6:38 pm

Re: Problems passing between blocks (Bump.lua)

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests