HELP WITH TILES [THE HARD WAY NOT TILED]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Joelrodiel
- Prole
- Posts: 27
- Joined: Wed Apr 20, 2016 3:40 am
HELP WITH TILES [THE HARD WAY NOT TILED]
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
Re: HELP WITH TILES [THE HARD WAY NOT TILED]
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.
- Joelrodiel
- Prole
- Posts: 27
- Joined: Wed Apr 20, 2016 3:40 am
Re: HELP WITH TILES [THE HARD WAY NOT TILED]
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]
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.
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.
- Joelrodiel
- Prole
- Posts: 27
- Joined: Wed Apr 20, 2016 3:40 am
Re: HELP WITH TILES [THE HARD WAY NOT TILED]
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]
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 . Regads.
Who is online
Users browsing this forum: veethree and 67 guests