Game prototype with nphysics 0.8

Hi!

I uploaded my currently very simple game that uses nphysics 0.8 and specs, and I wanted to 1., brag about it, and 2., share it for people who get stuck on API usage and want to see an example that works:

Here’s what it looks like: https://gph.to/2IxRouD

That’s pretty cool! I love the concept of two “parallel” worlds. (Though it does not seem to handle window resizing.) Do you intend to post this to https://www.reddit.com/r/rust_gamedev/ as well to reach a larger audience?

I’m not a Reddit user so that didn’t even occur to me, but sure!

Posted it here: https://www.reddit.com/r/rust_gamedev/comments/8uictk/game_prototype_with_nphysics_08_and_specs/

Hi, I’m trying to learn how to use nphysics, and I was looking through your project.
For some reason it does not compile, I get:
error[E0034]: multiple type_id found
error: could not compile downcast

Do you know how this could be fixed? Really want to try out this example :grin:

Chances are that this game prototype is not compatible with your version of the Rust compiler. In the past, the type_id function did no exist (or at least was not exported publicly) on the standard library. Now it does, and that what causes this compilation error.

So the solution is either to downgrade your compiler to an older version (not sure exactly which one), or upgrade the dependencies of this game prototype to use the latest version of nphysics/ncollide/nalgebra (but that my not be straightforward depending on how much breaking changes happened since then).

1 Like