I have written a small size project, for learning purpose. It's an Asteroid clone based on SDL2 crate. It seems to be a quite common project when learning rust.
The project is functional, and I wont make significant changes excepted improving code quality. Nevertheless, I would appreciate that competent people have a look at the code source, and give me suggestions/advices in order to write a more idiomatic code in particular on these subjects:
-My Iterator usage (feels very basic and C++ like).
-One/Zero/MinusOne traits in maths (Is that the way to do so ?).
-My usage of modules (I often hesitate between creating module or enclosing struct)
-Game constants: Is there a better ways to define/store them ?
-Dyn usage : I could have use it with a kind of 'drawable' trait but I'm ignorant of cost of dyn at runtime (equivalent to C++ virtual ?) . Nevertheless I use it in non intensive code.
-Any other suggestions/criticisms that contribute to a better rust usage.
You will also see that I'm quite reluctant to use external crate, that's why I use xorshift32 generator in place of the famous rand crate, and wrote my vector/matrix code (very interesting from learning point of view).
The code can be found : here
Thanks in advance and best regards,