I'm constructing the basis of a game and when the character hits an NPC, I want a number to float around the player for a second or two. The problem I'm having is when I try to draw the number following a parabolic equation, all that gets drawn is the number in a diagonal line, as seen below.
The equation I want it to follow is x^2/50 + 2x
, from x=0 to x=100.
Here is the code I've made.
for(int x=0; x<100; x++) {
g.drawString("5", x, ((x^2)/50) + (2*x));
}
I've adjusted the equation in multiple ways so that the line is wider and skinnier, but still having no luck. Any ideas about where I'm going wrong?