I want when the ball collides with the platform to start the gameOver scene. try with:
this.gameOverBar =
this.physics.add.sprite(400, 600, 'plataform')
.setSize(190,8)
.setDisplaySize(1100,400);
this.physics.add.collider(this.gameOverBar, player, GameOver);
function GameOver(){this.scene.add("SceneC", new SceneC)}
but when the ball collides the screen freezes
¿How do I call the gameOver function when the Ball
collide with bar?
this.physics.add.collider(this.gameOverBar, player, GameOver);