A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [Help]/[Problem] Help with Archery Sim

Hybrid View

  1. #1
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You have cos and sin mixed up and I am not sure why you need so several angle variables.

    PHP Code:
    var angle = -45;
    arrow1.onEnterFrame = function () {
        var 
    speed 5;
        
    angle += 1;
        
    this._x += speed Math.cos (angle Math.PI 180);
        
    this._y += speed Math.sin (angle Math.PI 180);
        
    this._rotation angle;
    }; 

  2. #2
    Junior Member
    Join Date
    Aug 2007
    Posts
    2
    Woah? Your code works way smoother than my own. For that example I was trying to do the same thing you just did but look at the code quality difference. Thanks.

    Now I have to figure out how to use this to simulate the flight of an arrow? Anyone got suggestions? Any will be greatly appreciated.

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