-
Notifications
You must be signed in to change notification settings - Fork 8
Feat: Add multiple food locations #2
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
base: main
Are you sure you want to change the base?
Conversation
…detection and spawning food sprites.
|
I also have a very janky branch on my fork that clears the pheromones, kind of like a soft reset. It currently is using unsafe rust, however, so I don't think it would be good to merge. |
|
Hey, thanks for creating the PR, I finally got some time to test it. The only problem I found with the behaviour is that when there are multiple food sources, the ants eventually end up going to the source that is the closest, hence all other food sources are rendered useless. Is there a way to make atleast some ants still follow other food sources mainly so that there's more activity on the screen? |
|
I was looking into that, but I don't understand how to properly code in rust, so my solution ended up using unsafe rust. |
|
My solution was to make the const food source tuple become a mutable tuple with an extra field for decay points. Every time an ant ate a bite of the food source, the counter would go down till it reached zero, where the food source would disappear. That way, the ants would path find to a different food source. It would also be possible to add food sources on the fly as well. |
|
Yes the ants pathing to a different source once a food source is complete is a natural way to fix this problem. |
|
That would make a lot of sense. I tried doing it, but I couldn't figure out
how to initiate a static mutable object on game start.
…On Fri, Aug 11, 2023 at 11:21 AM Bones-ai ***@***.***> wrote:
Yes the ants pathing to a different source once a food source is complete
is a natural way to fix this problem.
I feel like the best way to implement this is to create a new plugin for
food, then have systems in place to detect ant collision and decrement its
food count (and maybe also food size)
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWDVHG6IWNYXEUF7TH6PFXLXUZEYNANCNFSM6AAAAAA27WKCQA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
It can be done using bevy resources. |
|
I'll look into how to do that. I have absolutely no idea how to create a plugin but its my goal to learn rust so I will figure it out. |
No description provided.