Bounding boxes on platforms?

Post Reply
Gaet
Posts: 8
Joined: Fri Jan 11, 2019 6:57 pm
Location: UK/France

Bounding boxes on platforms?

Post by Gaet » Mon Feb 11, 2019 9:16 am

Hi,

I'm working on a scrolling platformer game and I've got a couple of questions.

1/ I've put some platforms to float in the middle of the screen. They are 5px high, but since they are created on a 16x16 tile, there is a white space area of 11x16. Therefore, either I put the platform at the top of the tile (left example on my screenshot) and my character bumps his head on the white space when he walks below the platform, or I put it at the bottom of the tile (right example on my screenshot) and when he goes on the platform he stands on white space rather than the platform itself. What would be a way to define a 5px high bounding box to my platform?

2/ Or alternatively... Is it bad practice to set my platforms as monsters, seeing as these do have an option for bounding boxes?

Many thanks in advance.
Attachments
Screen Shot 2019-02-11 at 09.10.43.png
Screen Shot 2019-02-11 at 09.10.43.png (31.85 KiB) Viewed 65 times
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Bounding boxes on platforms?

Post by dale_coop » Mon Feb 11, 2019 11:48 am

Hey Gaet,
Asset are minimum 16x16 pixels, and collisions attributes are for the entire 16x16 tile. You can't have bounding box for tiles, here.
It would not be bad to use monster object as platform, but... first, you will have to modify the code in order to make it not hurting your player (for your monster as platform and not for al your monsters). Second, you are limited at 8 sprite by scanline by the hardware else some will not be displayed... and not many more for the entire screen before it slows down.
Better idea would be to try make them a little taller... to almost fit 16x16?
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Gaet
Posts: 8
Joined: Fri Jan 11, 2019 6:57 pm
Location: UK/France

Re: Bounding boxes on platforms?

Post by Gaet » Mon Feb 11, 2019 12:45 pm

Thanks Dale. Perhaps the best workaround for now would be to keep them as is, but to put them high enough so that the player cannot reach them when he jumps directly under.

Or, to try to do the monster trick and make sure that they are not all on the same scanline.

By the way, if I wanted them to move left and right, having them as monsters would be a good-ish idea too, right?
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Bounding boxes on platforms?

Post by dale_coop » Mon Feb 11, 2019 2:21 pm

Yep, moving platforms... some users tried to made that, but I never seen any tutorial. Because monster hurts you (so you will have to deactivate that part but only for platformer? how to differentiate?) and you will have to make your player follow the platform movements, ....
Yeah it's doable but need to code some lines ;)
(Personally I am not sure if I would have to digg into that right now... and having something working before the end of the competition) :p

Oh, I was thinking about your platforms... you would make the "one way" types, it means the player could jump on it from under:
http://nesmakers.com/viewtopic.php?f=23&t=1667&p=10330
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
Mugi
Posts: 287
Joined: Thu Dec 27, 2018 8:30 pm

Re: Bounding boxes on platforms?

Post by Mugi » Mon Feb 11, 2019 2:28 pm

you could just make your monster object not be a monster :P (there's a tickbox for that in object details) that will stop it from hurting you.
dealing with the whole standing on them etc will be another story (or having the player move with them when standing on it. Definitely can be done but takes some fiddling around.)

as far as moving platforms go, i made a draft that... "works" but making it out of monsters is infinitely easier than messing up with moving collision table attributes.
Gaet
Posts: 8
Joined: Fri Jan 11, 2019 6:57 pm
Location: UK/France

Re: Bounding boxes on platforms?

Post by Gaet » Mon Feb 11, 2019 4:37 pm

Thanks both, very useful to get your perspective.

And yes, making them one-way is a good alternative. I tried that yesterday but it didn't work, so I'll have a go at the solution posted in your link Dale.
Post Reply