Estoy construyendo un juego de plataformas básico usando la física de ExcaliburJS . Habilité la física en el juego principal y en mis elementos Actor . Todo esto funciona de acuerdo con el código de ejemplo, con la excepción de estas propiedades físicas:
this.body.bounciness //and friction, mass, inertia this.body.limitDegreeOfFreedom.push(DegreeOfFreedom.Rotation)El cuerpo no rebota y todavía puede girar alrededor del eje z. Toda la clase:
export class Mario extends Actor { constructor(texture) { super({ width: texture.width, height: texture.height }) // collision box size is working this.graphics.use(texture.toSprite()) // enable physics this.body.useGravity = true // working this.body.collisionType = CollisionType.Active // working this.body.bounciness = 0.7 // not working this.body.limitDegreeOfFreedom.push(DegreeOfFreedom.Rotation) // not working // all the console logs are working console.log(this.body.mass) console.log(this.body.inertia) console.log(this.body.bounciness) console.log(this.body.friction) console.log(this.body) } }En mi juego habilito la física con
class Game { constructor(){ Physics.useRealisticPhysics() Physics.gravity = new Vector(0, 800) this.engine = new Engine() // ... } }¿Cómo puedo agregar rebote y limitar la rotación en el eje z en ExcaliburJS?