Scene setup
Now that we chose a data structure and designed our algorithm, we need to set up our scene. At the moment, at the start of our game, the player character shows up in the corner of the screen with a black backdrop. The player can move in four directions but could potentially move off screen. The player can also move under the text that shows the player's health. We should fix this so that we can better see our PCG algorithm in action.
Player positioning
Previously, we said that a starting grid of 5 x 5 for our initial Game Board would be a good metric. So let's continue with a 5 x 5 Game Board in mind. If our 5 x 5 grid starts with the X-Y coordinate or (0,0) in the lower-left corner and (4,4) in the upper-right corner, then (2,2) will be the center of the grid. Select the Player prefab in the Hierarchy panel and set both the X and Y values to 2
.
Each sprite in our sprite sheet is 32 x 32 pixels. When the sprite sheet was imported...