Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision FIXED on both entities #61

Open
rontrek opened this issue Aug 28, 2019 · 6 comments
Open

Collision FIXED on both entities #61

rontrek opened this issue Aug 28, 2019 · 6 comments

Comments

@rontrek
Copy link

rontrek commented Aug 28, 2019

Hi, I'm trying to implement a roaming enemy or npc entities which stops the player when collided and vice versa. How do I go about this? If I set FIXED on both player and npc, the npc still slides away when collided.

@Joncom
Copy link
Collaborator

Joncom commented Aug 28, 2019 via email

@rontrek
Copy link
Author

rontrek commented Aug 28, 2019

Thanks @Joncom. But I want them to cancel each other out not weaker than the other. If a player bumps the npc, the player stops, same goes with npc when bump into the player.

In short, all entities will be stopped when bumping into each other and they cannot push each other aside. I'm trying to do a top down game.

@Joncom
Copy link
Collaborator

Joncom commented Aug 28, 2019 via email

@rontrek
Copy link
Author

rontrek commented Aug 28, 2019

Yes, the results:

ACTIVE-ACTIVE - still slides either entities
LITE-LITE - just passes without any collision

should a FIXED-FIXED type stopped both or is this a bug?

https://impactjs.com/forums/help/fixed-vs-fixed-collision

@rontrek
Copy link
Author

rontrek commented Aug 28, 2019

..also quoting the specific documentation page, it says:

The behavior for FIXED vs. FIXED collisions is undefined.

https://impactjs.com/documentation/class-reference/entity#collides

Is there a workaround?

@Joncom
Copy link
Collaborator

Joncom commented Nov 7, 2024

In my opinion, FIXED vs FIXED should be updated so that it is defined. Such entities should simply not move each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants