Game prototype with nphysics 0.8


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:

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 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:

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