How to know which entity collided after Game.physics().move() method? #668
Replies: 3 comments
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022).
Posted: 2019-05-31 20:44:46
User: CalvinMT [] (age: 1451 days 🔥; posts: 114)
Hi!
I'm wondering if their is currently a way to know with which entity an other entity has collided with after making one of them moving with the ~~*~~Game.physics().move()* method?
Edit:
I don't know if I'm clear enough, so here's an example.
-Entity_A is moving towards entity_B and entity_C using the the ~~*~~move()* method from ~~*~~Game.physics()*.-Entity_A suddenly stops in front of entity_B and entity_C because it is colliding with one of them.-How to know if entity_A collided with entity_B or entity_C?Obviously, I was hopping that the move() method would give the entity with which entity_A collides with, but it only returns a boolean.
I tried to check intersections, but they aren't intersecting. And in my case, it would cost a lot to check through each entity anyway.
Edit2:
I think it may be important to specify that entity_B and entity_C are both collision boxes created from the LITIengine CollissionBox class.
Beta Was this translation helpful? Give feedback.
All reactions