3 minutes ago, Halpmelurngewd said:
Okay so when does it run. For instance does it run each time the player takes damage?
If a player attacks an orc enemy then you would do the attack, check the health and decide if the orc is alive or dead. You only call such functions on a as needed basis.
The better you are at creating solutions to problems, and the more logical you are the easier this will all come, but it's all useless unless you know how to use the tools available (such as a programming language).
Your best bet is to get a book and start from front to back with something like C#. You can try Head First C#, or C# in a Nutshell.
Otherwise check out MSDN:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/
https://www.microsoft.com/net/learn/in-browser-tutorial/1
I also do not recommend you start with game programming (using engines, apis, libraries related to game dev) until you have enough general programming knowledge and experience. You can still learn general programming with games in mind, but at a more simple level (text based).
You will just add to the confusion if you jump in too deep at the start without a strong foundation. Pick up a book, and write as much code as you can. Make alterations to the code you've learned, and take those concepts to create mini projects.