Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Add a feed system #51

Closed
marotili opened this issue May 4, 2019 · 4 comments
Closed

Add a feed system #51

marotili opened this issue May 4, 2019 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@marotili
Copy link
Contributor

marotili commented May 4, 2019

At the moment, entities will starve to death.
In PerformDefaultAttackSystem check if the defending entity dies, if that is the case, add the amount of nutritional value (a new component) to the fullness of the attacking entity.

@marotili marotili added help wanted Extra attention is needed good first issue Good for newcomers labels May 4, 2019
@marotili marotili added this to the 0.1 MVP milestone May 4, 2019
@erlend-sh
Copy link
Member

After this is done we’ll come up with a way for a dead entity to leave a dead body that several predators will feed on. One large herbivore body should be enough to bring several predators to max fullness.

@hbina
Copy link
Contributor

hbina commented May 19, 2019

Hi I would love to work on this, I am fairly new to Rust so any guidance is appreciated!

@marotili
Copy link
Contributor Author

Hi @hbina,
If you have specific questions, feel free to ask them in the Amethyst discord in the #showcase-team channel.
If you already have some code, even if it is not working, you can create a WIP pull request so that we can help you fix errors etc.

What you need to do:

  • Create a NutritionalValue component that stores an f32 value. If you search for Fullness, you should have a very similar example. You should be able to set the component value in the prefabs (resources/prefabs folder).
  • The next step would be to modify PerformDefaultAttackSystem so that it reads the NutritionalValue storage and writes to the Fullness storage. There is code modifying the health in there - that's where you should check if the health turns to 0. In that case, you should add the nutritional value of the defender (defender_set) to the fullness of the attacker (attacker_set).

I hope that helps :)

@marotili
Copy link
Contributor Author

Implemented in #69

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants