This week, the laser cannon weapon's firing functionality was implemented locally using a line renderer and a color material to display the laser. Building on the previous weapon system architecture, the laser cannon deals will all of its part specific code on a script attached to the projectile it fires. When this projectile is instantiated, a line renderer is spawned in the direction of the cannon's barrel with an attached Damage Dealer script This script damages any parts it overlaps with (and ensures that each part is only hit once).
The Bottom Line
Additionally, the previously discussed architecture of the weapon parts system will enable fast creation of new varieties of several weapons. For example, the laser cannon is a weapon that charges up and only fires if the charge has been held for a certain amount of time. To create an entirely new laser weapon that burst fires lasers, one script and a set of prefabs will be all that is needed. This is because the generic functionality of a turret (rotating, raising and lowering, and firing) is all contained in a set of scripts that can be applied to any weapon. A new script that listens for the weapon's firing event can generate the desired effect for the weapon without having to rewrite code or waste time. That time will be used to create several varieties for each weapon which means two things: there will be more content, and there will be more interesting choices.
-Aaron from the Battle Design Team
Comments