Java: moving ball with angle?
<p>I have started to learn game physics and I am trying to move a ball with an angle. But it does not change its angle. Java coordinate system is a little different and I think my problem is there. Here is my code.</p>

<p>This is for calculating x and y speed:</p>

<pre><code> scale_X= Math.sin(angle);
 scale_Y=Math.cos(angle);
     velosity_X=(speed*scale_X);
 velosity_Y=(speed*scale_Y);
</code></pre>

<p>This is for moving ball in run() function:</p>

<pre><code>  ball.posX =ball.posX+(int)velosity_X;
  ball.posY=ball.posY+(int)velosity_Y;
</code></pre>

<p>I used <code>(int)velosity_X</code> and <code>(int)velosity_Y</code> because in <code>ball</code> class I draw object </p>

<pre><code>g.drawOval(posX, posX, width, height);
</code></pre>

<p>and here <code>g.drawOval</code> requires <code>int</code>. I dont know if it is a problem or not. Also if I use angle 30 it goes +X and +Y  but if I use angle 35 it goes -X and -Y. I did not figure out how to work coordinate system in Java.</p>
