Hassurunous / TapKnight

0 stars 0 forks source link

Updates to TapTargets and Spawning functions. #1

Closed Hassurunous closed 6 years ago

Hassurunous commented 6 years ago

Updated the TapTarget spawning in GameController to fix the overlapping spawn times of some targets. Now offsets the spawn of the next target based on the lifetime of the previously spawned target. Also updated the methods of TapTarget and GameController to separate some of the concerns of each of the functions, improve modularity, and add several descriptive comments that hopefully make the code much easier to parse. Last, and possibly the largest change, moved the RayCast checking functionality away from the TapTargets themselves and into the GameController, so that it can keep track of specifically which target was hit. While this doesn't currently affect anything (since we have limited spawning to a single target) in the future this could allow for multi-target spawning to increase the difficulty, for example. Also makes more sense to check for those things in the main script, rather than in the individual scripts of the various components of the game, and will allow for the possibility of menu controls, easter eggs, and more.