Ahh, the shotgun. When the baddies are closing in, there isn't much else that will have the devastating affect on the target as a shotgun. In our game, the scout will be equipped with a shotgun. Combined with his sprint ability, the scout's best strategy will be to time the use of the sprint to get in, let off a few blast, and get out. For the shotgun blast to look like a shotgun blast, it must behave a bit differently from most of the other weapons in the game. Weapons like the pistol and machine gun will fire in a straight line, all the time, while the shotgun must have a spread.
I went through a few different ideas on how to accomplish this, but I couldn't get it quite right. Thanks to the help of John O'Leske, our course director, he was able to point me in the right direction and the shotgun now has proper blast. By adding one more step to the calculation, the effect can be achieved quite easily. Just like with the other guns, the first step is to find the vector between the player and his where the crosshair is aimed. Then, we find the angle of that vector. Then to change the trajectory of this piece of the shotgun blast, we rotate that vector a bit. Repeat for each piece of the shotgun blast, in our case 5 times, changing the vector a bit, and a simple, but effective shotgun blast is achieved.
Check back soon for more information about Medusa!
Wednesday, November 30, 2011
This is my BOOM STICK! Quick and easy top-down shotgun effect.
Posted by Joe Fink on 10:16 PM
0 comments:
Post a Comment