The MainActivity of the Android game that I am writing needs to extend PApplet, a class inherited from the Processing library, on which the entire game is based:
public class MainActivity extends PApplet{
//code that can use PApplet methods, but not BaseGameActivity ones.
}
Now, I would like to implement Google Play Services for achievements and leaderboard using the BaseGameUtils library.
To use the BaseGameUtils library, my MainActivity needs to extend BaseGameActivity, a class inherited from the BaseGameUtils library:
public class MainActivity extends BaseGameActivity{
//code that can use BaseGameActivity methods, but not PApplet ones.
}
This, however, does not work, since java does not support multiple inheritance:
public class MainActivity extends PApplet extends BaseGameActivity{
} //INVALID!
Therefore, I would like to know of any alternatives you can think of, since I really need to use methods from both libraries. I tried declaring PApplet and BaseGameActivity objects and using their methods, but it did not work. I tried creating a separate class that would extend BaseGameActivity and then instantiate it from MainActivity and use its methods inherited from BaseGameActivity, but it didn't work. I tried other ways (which might not have made sense, but you know, trial and error...), but it didn't work.
I am sure there must be a workaround, but after having used all the resources that main brain has, I still couldn't find any. Therefore, I am asking you for help.
Thank you in advance!