Hello!
I'm working on a simple 2D Game Framework. Currently it's creating a window, but I'm working on an update method.
I constantly export the framework as a .jar file, and I've added it to the game's build path (using eclipse). I wonder if I can check all classes in the game-project (the project in which I've refecrenced the Framework in) for a specific method (for example update()) and call all found methods with that name from the framework's main class, like this:
public class FrameworkClass1 { private void checkForUpdateMethods() { // Check for update methods on program start } public void update() { runAllFoundUpdateMethods(); // Run all update methods found in the scan } }
I wan't to do this because it would be a simple way to update and render the game.
If the main game-class look something like this:
public class Game { public void update() { // Update the game every time this is ran } }
it will be automatically updated, because it contains a method named update(), instead of naming the main game-class with a specific name etc.
It will simply be more flexible that way!
Thanks!
/TheDDestroyer12