A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Problems with custom bezier curves/gestural movement

Threaded View

  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    21

    Angry Problems with custom bezier curves/gestural movement

    Some background before I get into it. I'm building a game where the player can flick an object around the screen crashing into other objects.


    All the object is doing right now is moving in straight lines and it goes by pushing the mouse button down then moving to another point and letting it go then it takes on the speed of that and the angle.

    The problem is that it only moves in straight lines, I want to give the player the ability to curve the object. Then the object would conform to that curve depending on the velocity so say that you're running fast you wouldn't be able to make a sharp turn quickly. (I've pasted a bit of the code below on how it moves and I've attached the whole program, it's in CS3)


    Code:
    	target_angle = Math.atan2(distance_y,distance_x);
    		
    		player_velocityX = Math.cos(target_angle)*rate;
    		player_velocityY = Math.sin(target_angle)*rate;
    The only equation I know that will get me a 3rd point is:

    Code:
    			getting curve distance = ((x1*x1) + (x2*x2))/2
    //Repeat for y
    But that will only give me a uniform curve every time, I need it to be specific to the movement.

    Are there any formulas I can apply that will allow the object to mimic the gesture of the user?

    Thanks
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center