Is there a good way to handle multiple enemies who can effect each oth

I haven't actually tried this, but say you were writing an audiogame in Rust and you want to have enemies that can kill or heal each other.
How would you do this though?
It seems the only way to keep track of everything is to use a container of some kind, but Rust won't let you get multiple mutable references to items in a container.
I'm thinking of making a container that keeps track of enemies via an ID, like the slotmap crate, but also lets you put enemies on a specific tile and efficiently be able to check if something is on a tile via a dictionary that maps coordinates to a list of what ever is on that tile.
Is this a good idea? Do I need to use a bunch of unsafe code and RefCell to make this work? Or should I be looking at something like Bevy?

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Dragonlee via Audiogames-reflector

Reply via email to