Last active
December 24, 2015 06:58
-
-
Save flagoworld/6760158 to your computer and use it in GitHub Desktop.
Damaging a ship works like this, i hope...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Energy = radiation energy released from impact, MJ | |
//Shield = shield absorbtion capacity, MJ | |
//Hull = amount of stress the hull can receive before collapsing, MJ | |
shield -= energy | |
if(shield < 0) | |
{ | |
energy = -shield; | |
shield = 0; | |
} | |
hull -= 0.5f * mass * velocity * velocity / 10e9f + energy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment