I am helping a friend of mine make of game of his design as a mobile app. Doing this process I have found pure mathematical functions to be helpful rather than just use if statements in all scenarios. I haven't studied math beyond high school level and thus I was hoping someone would be able to help me as I haven't been able to find the type of function that I require on the internet.
The function I am looking for takes two inputs, x and y. I would like this function to return the sum of x and y, however, if x is 0 I need that sum to be zero. x is never going to be negative but y can be negative.
I would appreciate it a lot if someone could help me with my problem. I apologies if my question is confusing or unclear and I would be happy to help you understand if the above text does not clearly formulate my problem.