Code4Community / platformer

MIT License
0 stars 2 forks source link

Move Tile Map Setup Code into new Method #13

Closed Tass0sm closed 2 years ago

Tass0sm commented 2 years ago

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.

  1. Find the super class of the HackingScene. It should be called ECSScene
  2. Make a new method called "setupMapAndCamera"
  3. Copy the code at the beginning of the HackingScene's create function to this method.
  4. Replace any reference to "SuperMarioBros-World1-1", "mario-tiles", or "World1" with an appropriate method argument.
  5. Replace the code at the beginning of the HackingScene's create function with a call to this method.
Tass0sm commented 2 years ago

Closed in 31e18f8b36ed2d45a9a6986e8a9215d34917233b