Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

98
Vistas
Excalibur JS physics only partly working?

I am building a basic platforming game using ExcaliburJS physics. I enabled physics in the main game and in my Actor elements. This all works according to the example code, with the exception of these physics properties:

 this.body.bounciness //and friction, mass, inertia
 this.body.limitDegreeOfFreedom.push(DegreeOfFreedom.Rotation)

The body does not bounce, and can still rotate around the z axis. The whole class:

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)
   }
 }

In my game I enable physics with

class Game {
  constructor(){
    Physics.useRealisticPhysics()
    Physics.gravity = new Vector(0, 800)
    this.engine = new Engine()
    // ...
  }
}

How can I add bounciness and limit rotation on the z axis in ExcaliburJS?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda