I quote this from Making your first Phaser 3 game: Part 1 - Introduction - Learn - Phaser
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
scene: {
preload: preload,
create: create,
update: update
}
};
In particular, the “physics” key is missing. This causes things like “this.physics.add” in the create function to fail, as this.physics is undefined.
I notice that it’s added in the second page, but that’s only AFTER the first use of “this.physics.add”. I think it should be moved to before it (or even at the beginning) to avoid confusion.