Mutant Madness - Building placement part 2
Building selection
A little update on the building placement. You can scroll with your mousewheel to select a different tower.
I made the following code to cycle through the towers:
//Mouse wheel checking m = LE.MouseZ(); if (prevM < m) { selectionID++; if (selectionID > 4) { selectionID = 0; Console.WriteLine("now 0"); } SetNewCurrentTempTower(); } else if (prevM > m) { selectionID--; if (selectionID < 0) { selectionID = 4; Console.WriteLine("now 4"); } SetNewCurrentTempTower(); } prevM = LE.MouseZ();
Range ring
Instead of creating a decal I thought it would be nice to display some rotating meshes to show the range of a tower. At the moment the meshes are not being adjusted by the terrain height but that is something on the to-do list. One thing I noticed was that the FPS dropped heavily when using this range ring. A loop was interfering with the process causing a lot of unnecessary instances being created.
Firing towers
I made a small beginning with the tower's firing mechanism. Towers are now able to lock on to a target if it is within range. The bunker and sniper tower are the only towers with a working firing mechanism. The canon and the flamer use rotation and have extra calculations for damage, rotation and area impact.
3 Comments
Recommended Comments