I can pause time in order to write as much code as I want without interruption.
livingcoder
This was a great blog post. I love Rust and Bevy, but I can definitely see why you made the switch.
The primary issue with your decision to use Rust/Bevy, for me, was that you were taking on the task of getting others to work in a difficult language for novice developers. I would never suggest Rust as someone's first language, coupling that with a regularly-changing library like Bevy.
I would love to know what the pros and cons were between Unity and Godot. If you were going to switch to C# anyway, Godot seems like the next logic choice to me, so I'm curious about what your team's evaluation was for that engine.
Basically, you can generalize your trait types into their parent (super) traits for situations when functionality is specific to those supertrait objects.
As an example, if you have a trait CanBark and it is a super trait for the trait IsDog, you can coerce your references of &dyn IsDog into a &dyn CanBark. You can then work with other trait types that share a super trait.
trait CanBark {
fn bark(&self);
}
trait IsSeal: CanBark { }
trait IsDog: CanBark { }
fn bark_as_group(barkers: &Vec<&dyn CanBark>) {
for barker in barkers {
barker.bark();
}
}
let spot: &dyn IsDog = get_spot();
let seal: &dyn IsSeal = get_seal();
let barkers: Vec<&dyn CanBark> = Vec::new();
barkers.push(spot); // coerced
barkers.push(seal); // coerced
bark_as_group(&barkers);
At least, I hope this is possible now. If it's purely "you can return a coerced type from a function", that is less useful.
When I learned Python I thought that not having a statically typed language was the way to go, but then it just became an issue when I was trying to ensure that everything was at least something like what I was expecting. Going back to statically typed languages even harder with Rust has been a dream. I love it.
The other person has to be asleep and hears it as a whisper in their dream.