I made a very large box collision and couldn’t fire at all, and enemies effectively committed suicide. So I did this:
- Made just a collision box on the barrier itself.
- Added members to the tile so that it references the next tile (and the previous which wasn’t needed), Quite fun turning them into a linked list.
- Parameterized the Spawn Tile method so you can decide whether to lock or not. At initialization the first barrier is unlocked, the rest are locked
- When moving through a barrier, when leaving I test if you are still in the current tile or next tile, only locking if you entered the next.
- When entering the next tile, I unlock it’s barrier, then spawn a new tile, linking it to the list
- Maybe unnecessary but made a method that not only deletes the tile, but unlinks it from the list.
Was a good learner.
Some screenshots:
Infinite Terrain Game Mode - Event Graph
Spawn Tile
If Progressed Execute
Next Minus Previous
Tile Eventgraph
Tile Viewport