Tower Defense Game

Different Scenes for different levels, so, need:

1. A way to create towers independent of scene
2. A way to spawn enemies independent of scene
3. Waypoints should be static on a level, but can be moved around freely.
4. Way for objects to target first, closest, last, (strongest?)
5. Way for projectiles/attacks to affect enemies
6. Way to upgrade towers.

Implementation details:

1. A prefab for each tower. When clicking empty ground [check if no tower tagged type tower is below mouse pointer](https://gamedev.stackexchange.com/questions/121994/how-to-get-which-gameobject-the-mouse-is-over-in-unity) and if none found, create radial menu around cursor. Clicking away from any buttons closes the menu. When clicking a button to select a tower it will be placed at the original click point.

2. Prefab for each enemy. A level controller will need to spawn in enemies (Initialize them) and then find a way to pass in the array of waypoints. The level controller will have a public array of stored waypoints so it can pass in that object to each enemy. Once the waypoint number == array length then decrease lives/whatever, then destroy self

3. Prefab for waypoints. Potentially find a way to put them in empty game object and use the array of children at game startup.

4. Every interval of the tower, the tower will ray-cast in a radius around it, (or maybe use a shell cast (check in an expanding radius around the tower (or both))) and keep track of the first object in the enemy array, that is within the radius (compare distance between tower and enemy vs radius), and if closest, just use the smallest number in radius, last is the inverse of first. The array of enemies will have to be passed into each tower when it is spawned (if arrays are actually passed by reference in unity). Based on the initial distance between the tower and the enemy, estimate the amount of time it would take to throw a projectile/attack. Then predict where the enemy will be in that time. This process can be repeated for further accuracy (make it a function?)

5. A prefab for each projectile would be needed. You would need to pass in the angle, position when initiated, but also it's lifetime if it has one, or any additional information in a separate function. They should be deleted when they leave the viewport. Each should have a way to move itself in a script attached to it.

6. A radial menu like the buy menu should open up around the tower, allowing you to upgrade specific things about the tower based on it's type. The radial menu could have an outer rim which indicated how many upgrades it has based on a dashed line on the outer rim.


Aesthetic decisions:
The entrance should probably have a machine that spits out the enemies (undecided what they will look like, potentially extra fingers or other hallmarks of ai art, or could look like glitches like missingno or like a jumble of pixels). The towers should be things like Artist (the basic tower). It can be upgraded from pencils, to paint brushes which have a splash radius on hit, to a paint roller which penetrates multiple enemies and has weaker splash radius. Another tower might be a painter, which starts by throwing three drops of paint, and then upgrades to a big projectile with an AOE attack on the ground, and then throwing multiple of them. Come up with other spins on artist based attacks (pixel artist, digital artist). Losing lives could have an impact on the background, making it look more glitchy

Story (brief):
It is 2022 and the emergence of AI art is threatening digital art spaces. Artists band together to attack the AI in an all out brawl. Protect the integrity of art by stopping them before they get too far.

Potentially helpful links:
https://gamedevbeginner.com/how-to-get-a-variable-from-another-script-in-unity-the-right-way/
https://www.youtube.com/watch?v=2pCkInvkwZ0
https://forum.unity.com/threads/c-global-variables-available-to-all-scenes.544901/
https://stackoverflow.com/questions/68189868/how-can-i-make-a-variable-that-i-can-access-in-any-unity-scene-unity

https://learn.unity.com/tutorial/waypoints#