Inter-entity Collision in Goature's System
Posted: Wed Mar 05, 2014 6:50 am
Hello Love community! I have been working with Love (and lurking these forums) for a month or so, and must say I've been enjoying it immensely
Greetings aside, I seem to have run into a bit of an obstacle I'm working on a platformer (using Goature's entity system) and am currently stumped in trying to figure out how to make the damn entities collide with each other! Currently, all entities are able to collide with the player (who was not made with the entity system) using simple bounding boxes, but cannot collide with one another because I do not know how to get the updated x and y positions from each individual entity.
Goature's system essentially makes a copy of all the information from the entity files (in this case, hellhound.lua & spike.lua) and places them into the table ents.objects with their unique x and y positions (as defined in ents.Create("name", x, y, BG)) each time you create an entity. The question is how I can access the updated x and y positions of each individual entity so I can check for collisions?
Ideally, I would like to edit the ents.Create function so that each time you create an entity, it stores the unique positional information of the entity in such a way that you don't have to manually add it to the collision check table. Honestly, I'm not sure how to do this, or if I'm even thinking along the right lines. Would anyone have an idea as to how I can go about addressing this issue?
Thanks in advance to anyone who takes the time to read/respond... much appreciated!!
P.S. It uses AdvTiledLoader so you'll need love 0.8.0 to run the .love.
https://bitbucket.org/rude/love/downloads I berieve you can get it herrrr if you don't have it.
Greetings aside, I seem to have run into a bit of an obstacle I'm working on a platformer (using Goature's entity system) and am currently stumped in trying to figure out how to make the damn entities collide with each other! Currently, all entities are able to collide with the player (who was not made with the entity system) using simple bounding boxes, but cannot collide with one another because I do not know how to get the updated x and y positions from each individual entity.
Goature's system essentially makes a copy of all the information from the entity files (in this case, hellhound.lua & spike.lua) and places them into the table ents.objects with their unique x and y positions (as defined in ents.Create("name", x, y, BG)) each time you create an entity. The question is how I can access the updated x and y positions of each individual entity so I can check for collisions?
Ideally, I would like to edit the ents.Create function so that each time you create an entity, it stores the unique positional information of the entity in such a way that you don't have to manually add it to the collision check table. Honestly, I'm not sure how to do this, or if I'm even thinking along the right lines. Would anyone have an idea as to how I can go about addressing this issue?
Thanks in advance to anyone who takes the time to read/respond... much appreciated!!
P.S. It uses AdvTiledLoader so you'll need love 0.8.0 to run the .love.
https://bitbucket.org/rude/love/downloads I berieve you can get it herrrr if you don't have it.