HELP WITH TILES [THE HARD WAY NOT TILED]

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
User avatar
Joelrodiel
Prole
Posts: 27
Joined: Wed Apr 20, 2016 3:40 am

HELP WITH TILES [THE HARD WAY NOT TILED]

Post 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:
User avatar
MadByte
Party member
Posts: 513
Joined: Fri May 03, 2013 6:42 pm
Location: Germany

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

Post 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.
User avatar
Joelrodiel
Prole
Posts: 27
Joined: Wed Apr 20, 2016 3:40 am

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

Post 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.
nyenye
Citizen
Posts: 62
Joined: Fri Dec 02, 2016 1:44 pm

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

Post 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.
User avatar
Joelrodiel
Prole
Posts: 27
Joined: Wed Apr 20, 2016 3:40 am

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

Post by Joelrodiel »

Thank you so much! Ill check out the libraries and try to implement them in my game. Thanks!
nyenye
Citizen
Posts: 62
Joined: Fri Dec 02, 2016 1:44 pm

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

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

Who is online

Users browsing this forum: MrFariator and 11 guests