I was wondering if I could go to a function from another one without explicitly addressing.
For example I am in the hello() but I want to go to bye(). After I get to hello, how can I go back without explicitly saying to go back to hello(). The reason for this is, I want to make a zombie combat scenario as it's own function and call it when necessary. Then I want to go back to the other function and continue the story. I want to be able to use the one Zombie combat scenario with other functions. How can I do this?
1 2 3 4 5 6
hello()
{
//code
//code
//code
bye();
and then it goes here
1 2 3 4 5 6
bye()
{
//code
//code
// And than something here that would make it go back to hello().
}
Well, when the bye() function terminates, it will return you back to that place in hello(). Otherwise, no. If you want to go back to the start of hello() based on some calculation done in bye(), just make it a loop with a conditional on the value returned by bye().