macosxnerd101, on 07 October 2013  04:31 PM, said:
You've had high school physics, trig or calculus right? Apply what you learned there to particle motion.
being able to think about problems mathematically is indeed important.
Posted 07 October 2013  09:45 AM
Posted 07 October 2013  09:48 AM
Posted 07 October 2013  10:21 AM
private void setVectors(){ //First vector double vectorX1 = player.getX()+10; double vectorY1 = player.getY()+10; //Second vector double vectorX2 = mouseX; double vectorY2 = mouseY; //Vector from player to mouse double deltaX = vectorX2  vectorX1; double deltaY = vectorY2  vectorY1; //Normalization ??? double unit1 = Math.sqrt(Math.pow(deltaX,2)+Math.pow(deltaY,2)); deltaX = deltaX / unit1; deltaY = deltaY / unit1; double radian = Math.atan2(deltaY, deltaX); speedX = speed*(float)Math.cos(radian); speedY = speed*(float)Math.sin(radian); }
This post has been edited by novakasss: 07 October 2013  11:33 AM
Posted 07 October 2013  01:52 PM
Query failed: unknown local index 'forums_search_posts_main' in search request.
