Open fterdal opened 5 years ago
Ah, I think I figured it out. We need the students to add the changes to config/config.js
about the physics. E.g.
physics: { // Optional: specify physics engine and configuration
default: 'arcade', // A simple and performant physics engine
arcade: {
gravity: { y: 1500 }, // Game objects will by default be affected by gravity
debug: false,
},
},
Otherwise, they can't use this.physics.add, because the physics object hasn't been initialized yet.
I get
Uncaught TypeError: Cannot read property 'add' of undefined
when I try to add the ground to the FgScene. Screenshot and code below:FgScene.js
Ground.js