Page 1 of 1

Surprising behavior using HC

Posted: Sun Apr 03, 2016 4:07 pm
by platypusmeister
Hi everyone!

In my journey for learning LÖVE, I started creating a simple platformer. I started yesterday, so I'm fairly new to this. I'm using Tiled to get a simple map with platforms, including an Object layer with polygons to mark them.

I import all of that using STI and it works like a charm. I didn't want to use bump, because I want to manage slopes and I'm not sure you can do that. I didn't use box_2d either. Well I tried, but after a while I thought it was too complicated for my first day. I opted for HC. After a while I understood the core concept so I wrote a STI plugin to automatically create my collision polygons. I added a fake player represented by a rectangle. I'm using HC to get the shapes colliding with my player and react accordingly ( So far, just setting the vertical velocity to zero ).

Everything works great, my character falls from the spawn point and stops on the platform. But a few seconds later, no collision is detected anymore. I added some 'print' to see if at least one shape was detected as colliding, but it's always the same, At first I see it all, but a few seconds later, nothing is detected anymore.

Also I noticed during my debugging process that adding 'print' in some part of the code made the bug appear later. So I suspect something about the framerate, but I still don't know LÖVE enough to be sure.

I couldn't find something online about this kind of problem, so here I am. Also if you think that HC for a simple platformer is not fitting, tell me which library would.

I included the .love file if you want to check it out yourselves.

Thank you all in advance!

Re: Surprising behavior using HC

Posted: Sun Apr 03, 2016 8:23 pm
by bobismijnnaam
I had some pretty weird problems using HC for a platformer. Made a pretty detailed topic about it here, didn't get a response. The problem seemed way over my head. Since I only wanted to try a few simple things I just bit the bullet and coded my own simple AABB tile collision system. I hope you have more luck than me!

Re: Surprising behavior using HC

Posted: Sun Apr 03, 2016 8:25 pm
by Nixola
There's a brief discussion about doing slopes in Bump with several ways and solutions in Bump's thread if I recall correctly

Re: Surprising behavior using HC

Posted: Tue Apr 05, 2016 2:33 pm
by platypusmeister
Hi guys!

Thanks for your answers. I switched to bump, and even if I don't have slopes so far, it feels better. Anyway, I think that it'll be good for my learning experience to try and implement the slopes myself.