Rinum / OpenAnt

Open Ant! Join us at reddit.com/r/openant and http://webchat.freenode.net/ #openant
http://openant.com
102 stars 20 forks source link

Food System specification. #13

Closed celx closed 11 years ago

celx commented 13 years ago

It's unclear in the milestone description how the designers envisioned the Food System to be written; what approaches are encouraged, discouraged, and is there anything of importance that should be kept in mind?

Oipo commented 13 years ago

Great question.

So here's what we want to have: A recurring event where food gets spawned. For simplicity, we'll stick to one source of food. Perhaps in the future we can have different kinds with different effects. Anyways, I think it's best if we both track time and the amount of food on the map.

I recommend using QTimers and qt signals and slots to check per, say, 30 seconds to see if there is less then 10 items of food on the map, and then spawn 100 or so. These numbers are completely arbitrary, of course.

This means that there needs to be some food class/object or so, which the map has a list of. The food object should also obviously have a location, and should, for now, only appear above ground.

Oipo commented 13 years ago

As per IRC: We decided that we might as well use the map.update function for this, instead of replicating it with qtimers/events.

new-guy commented 12 years ago

I've started working on this. The current version that I have makes sure that there are at least 20, and at most 100 pieces of food on the map. I'll do a pull request once I get it working to the point that the user can click on food and pick it up (unless I should do one sooner).

Rinum commented 11 years ago

With the reboot, I'm closing current issues.