This week I continued the development of the laser turret and that has reached its gripping conclusion. The turret now smoothly pans along it’s vision cone and when it notices a missile will snap to it and fire, complete with a muzzle flare. I do want to add a couple of wisps of smoke as well just to add a nice after effect to the process.
One thing I have noticed recently is that the laser towers need some optimisation. There is a distinct lag occurring when they are in levels. According to the debug profiler it’s because the towers continually check to see if the towers they are connected to are still there and this is a bit on the costly side. So I need to come up with a way to check the laser wires once and then only check again if a tower has been destroyed, perhaps even storing a variable in each tower to tell it which towers it was connected to. Yeah, that sounds like the way to go. That way I can get the tower to check if the towers still exist and if they don’t then and only then recheck for laser wires. Right, now I just need to convert that into workable code.