Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

104
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda