Thanks for the answer guys.
I can see some misunderstandings to how it works and why I need to save a "method", let me explain the real story behind all this.
I'm making to damaku game, which basically means a curtain of bullets.
An enemy, for example, has it's own behaviors for shooting and moving, etc, which is done by a method that acts depending on the current counter. for example, if the counter is 10, then fire 260 bullets in all directions. There are a lot of of these conditions, and they come together to form a method that acts as a script for how the enemy should act. So If I save the method, it equals saving the script.
I could just implements a different script-call method for each type of enemy, but there are probably over 60 types of enemy each with different types of movement. I would have to define 60 classes just to have 60 enemies that do different things.
and since saving a method isn't really possible....
i've thought about making a parser, that takes in instructions from a .txt file, and then executed the instructions. But bullets don't just move in a straight like with a constant speed. They can speed up, turn, move in a function, home, or even make more bullets... That makes the parser sound a lot harder to do. And I want this to be a game where players can make their own bosses with cool bullet
patterns that they define. 3000 bullets in a circle is easy with a for-loop, but how would I put that for-looping command into a parser and then actually execute it?
I've attached a sample bullet attack, involving hundreds of bullets being fired within seconds. How would I make a parser for a attack such as that
P.S. where's the Java in General forum?