How to Automatically replace Lines of Code?
I would imagine this question has been answered before however I am unable
to find an answer for it so I figured I'd ask here.
If there is already a term for this, please inform me of it - thanks!
Anyways, currently I have bullets created as such:
bullet.create(x, y, xChange, yChange);
I would like to be able to enter
bullet.create(x, y, 40 <angle>, 5 <speed>);
or some such and then run it through a program to calculate xChange and
yChange from the Angle and Speed (Which I already have) and have it edit
the java file itself, as opposed to outputting into the console.
TL;DR: How do I pull information from a java file, run it through an
equation, and replace the input code with the equation's output?
Thanks!
No comments:
Post a Comment