We have code for setting up a tile map and the camera inside src/scenes/hacking-scene.js. When we make more levels, we don't want to duplicate this code, so we should move into into one function into a super class of every level.
Find the super class of the HackingScene. It should be called ECSScene
Make a new method called "setupMapAndCamera"
Copy the code at the beginning of the HackingScene's create function to this method.
Replace any reference to "SuperMarioBros-World1-1", "mario-tiles", or "World1" with an appropriate method argument.
Replace the code at the beginning of the HackingScene's create function with a call to this method.
We have code for setting up a tile map and the camera inside
src/scenes/hacking-scene.js
. When we make more levels, we don't want to duplicate this code, so we should move into into one function into a super class of every level.HackingScene
. It should be calledECSScene
HackingScene
's create function to this method.HackingScene
's create function with a call to this method.