Discuss Scratch
- minder_
-
3 posts
Enemy-to-enemy collisions
A naive way to fix this is by just using
But i did get reminded of a tutorial by griffpatch about making boids where finding the distance to other clones were needed for it. Maybe that will help
<touching color [#ff0000] ?>but id guess that isnt what you want
But i did get reminded of a tutorial by griffpatch about making boids where finding the distance to other clones were needed for it. Maybe that will help
- Koamodo975
-
1000+ posts
Enemy-to-enemy collisions
yeah no. thanks for trying tho A naive way to fix this is by just using<touching color [#ff0000] ?>but id guess that isnt what you want
But i did get reminded of a tutorial by griffpatch about making boids where finding the distance to other clones were needed for it. Maybe that will help
I'll check out griffpatch's thing, was it scrolling?
- GamingCat12345
-
100+ posts
Enemy-to-enemy collisions
I don't know about what you trying to create exactly, so this answer is just from whatever I think you meant (from the way earlier posts)
Create lists:
-List for clones to see each other's positions (i'll refer to it as “enemy pos”)
-List for all walls and other solid level components the enemies need collision for (i'll refer to it as “level pos”)
Clones of enemies are assigned their own unique ID number.
The clones will update the item on the enemy pos list that correlates to their ID
Clones of level objects do the same but on the level pos list.
Once you know the sizes of every object, use math instead of actual collision to detect if the enemy is colliding with something
Using more math, you can determine the best direction to leave collision.
If you want the enemies to naturally and smoothly avoid each other, have a third list that shows the predicted next position of each enemy so they stay out of each other's paths.
I can share some math if you need help, just ask which ‘equations’ you need
Create lists:
-List for clones to see each other's positions (i'll refer to it as “enemy pos”)
-List for all walls and other solid level components the enemies need collision for (i'll refer to it as “level pos”)
Clones of enemies are assigned their own unique ID number.
The clones will update the item on the enemy pos list that correlates to their ID
Clones of level objects do the same but on the level pos list.
Once you know the sizes of every object, use math instead of actual collision to detect if the enemy is colliding with something
Using more math, you can determine the best direction to leave collision.
If you want the enemies to naturally and smoothly avoid each other, have a third list that shows the predicted next position of each enemy so they stay out of each other's paths.
I can share some math if you need help, just ask which ‘equations’ you need
- Koamodo975
-
1000+ posts
Enemy-to-enemy collisions
holy cow this is good. I mean all the enemies and stuff have different sizes, and there are level objects inside hollow level objects… will I have to create a dimensions list or something? I don't know about what you trying to create exactly, so this answer is just from whatever I think you meant (from the way earlier posts)
Create lists:
-List for clones to see each other's positions (i'll refer to it as “enemy pos”)
-List for all walls and other solid level components the enemies need collision for (i'll refer to it as “level pos”)
Clones of enemies are assigned their own unique ID number.
The clones will update the item on the enemy pos list that correlates to their ID
Clones of level objects do the same but on the level pos list.
Once you know the sizes of every object, use math instead of actual collision to detect if the enemy is colliding with something
Using more math, you can determine the best direction to leave collision.
If you want the enemies to naturally and smoothly avoid each other, have a third list that shows the predicted next position of each enemy so they stay out of each other's paths.
I can share some math if you need help, just ask which ‘equations’ you need
as for the math I really do need to see the collision checking equation since I'm not sure how it would check based off the size.
grammar man is BACK ya'll