Surprising behavior using HC

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
platypusmeister
Prole
Posts: 2
Joined: Sun Apr 03, 2016 3:48 pm

Surprising behavior using HC

Post 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!
Attachments
timescroll.love
(1.09 MiB) Downloaded 114 times
User avatar
bobismijnnaam
Prole
Posts: 18
Joined: Thu Mar 17, 2016 5:18 pm
Location: Netherlands
Contact:

Re: Surprising behavior using HC

Post 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!
taart
lc = love.timer -- love.chrono :-)
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Surprising behavior using HC

Post 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
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
platypusmeister
Prole
Posts: 2
Joined: Sun Apr 03, 2016 3:48 pm

Re: Surprising behavior using HC

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

Who is online

Users browsing this forum: Bing [Bot] and 3 guests