Bounding boxes on platforms?

Gaet

New member
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.8 KB · Views: 1,360

dale_coop

Moderator
Staff member
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?
 

Gaet

New member
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?
 

dale_coop

Moderator
Staff member
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
 

Mugi

Member
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

New member
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.
 
Top Bottom