Page 1 of 1

HELP WITH TILES [THE HARD WAY NOT TILED]

Posted: Sun Dec 04, 2016 8:09 am
by Joelrodiel
Hi, I'm working on a program that would have maps with number tiles and I would like to know how I could make it handle collision. I have the map loading and drawing, but I have NO idea how to handle collision with a character in the map. If there's any way you could help me, I would greatly appreciate it. Here's the code https://drive.google.com/drive/folders/ ... sp=sharing :awesome:

Re: HELP WITH TILES [THE HARD WAY NOT TILED]

Posted: Sun Dec 04, 2016 8:19 am
by MadByte
You could check on which tile the player currently is and in which direction he (wants to) move. Before you actually move you have to check if the next tile is walkable and if not you just use the tiles x and y to prevent the player from going there.

Re: HELP WITH TILES [THE HARD WAY NOT TILED]

Posted: Sun Dec 04, 2016 8:21 am
by Joelrodiel
Do you have any example or code that I could see to guide me on how to do it. Ive been trying to figure this out for the longest time.

Re: HELP WITH TILES [THE HARD WAY NOT TILED]

Posted: Sun Dec 04, 2016 9:20 am
by nyenye
To handle collisions, I recomend using a library, given the many attempts that I have done personally to implement a robust collision system, and failed TT.

Libs out there that I know: bump and HardonCollider.

I personally use Hardon Collider because of its flexibillity, but bump handles some things automatically, that HC don't.

Can't give you links right now, but a fast search like 'hc love2d' should get you to the repo. Also the documentation for HC is very detailed, and I could give some tips maybe.

Re: HELP WITH TILES [THE HARD WAY NOT TILED]

Posted: Sun Dec 04, 2016 5:15 pm
by Joelrodiel
Thank you so much! Ill check out the libraries and try to implement them in my game. Thanks!

Re: HELP WITH TILES [THE HARD WAY NOT TILED]

Posted: Mon Dec 05, 2016 1:31 pm
by nyenye
No problem, if you need any help or have any doubt you can PM me if you want, I am also learning, but two minds are better than one :D. Regads.