-
Notifications
You must be signed in to change notification settings - Fork 191
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
Objects only reacting to certain objects #210
Comments
There are a couple of ways to do this with Pymunk, depending on exactly what you need. You wrote that arrows from a friendly soldier should not collide with other friendly soldiers. The easiest solution would be to use a custom There are also more complex setups possible, but then you need to describe exactly how it should work :) Two questions to narrow it down:
|
Arrows should not collide with other arrows. Soldiers might collide with other soldiers in melee attacks. It would be nice if a soldier could have knockback when hit with an arrow. BTW I am using the Python arcade library for this. I have no idea how to plug this into my code. |
Alright. Then you can do it by putting read team soldiers in one category, red team arrows in one category, blue team soldiers in one category and finally blue team arrows in one category. Then just specify the mask on each category what other they should collide with. I recently wrote an answer on SO that explains it: https://stackoverflow.com/questions/72795180/how-to-use-pymunk-categories-and-masks/72807516#72807516 |
I am in the process of making this battle simulator game where two armies battle each other when they are in ranks. Of course, the soldiers shoot arrows at the enemy, but a problem with this is that the soldiers' arrows on one side hit other soldiers on the same side. This propels them forward, so they look like this:
Blue is on one side and red is another side. The arrows propel the soldiers in front of them forwards as they hit them. How can I make it that the arrows only hit a specific side and go through the soldiers that fired them?
For example, an airplane would fly over and go through a building, not reacting to it or the building moving, but a missile could destroy that same building. Changing the body types of these objects to KINEMATIC, STATIC, or DYNAMIC doesn't work.
The text was updated successfully, but these errors were encountered: