|
|
|||||
Topic, Path System | ||||||
| ||||||
You must register or log in to post a message.Updates [V 0.6]: -Improved accuracy -Minor code efficient improvements, Example: Example.as How it works: First you'll need an Array of 'blNode's which have a value of x,y & speed, these are the node locations, Then you'll need a 'blPath', this does the real stuff, this take in your array of nodes, an array of targets (which objects to move), a 'Global Speed' value, & a directioning Boolean (if set to true, the objects will point towards the next node). Once you've created these, then you'll need your own Enter_frame event to make it actually Go... blNodes properties & functions (blNode extends Point): blNode.x:Number blNode.y:Number blNode.speed:uint (0 to 200) blNode.setToPoint(newLocation:Point) blNode.toString():String blPath properties & functions: blPath.nodes:Array blPath.targets:Array blPath.globalSpeed:uint blPath.directiong:Boolean blPath.update() blPath.reverse() blPath.realSpeed() (gets the actual speed of the path, effected by node Speeds) blPath.toString():String blRect (creates 4 blNodes from a rectangle) properties & functions: blRect.setSpeed (nodeToChange:uint, new_Speed:Number) blRect.setGlobalSpeed ( new_GlobalSpeed:Number) (sets all node speeds to the new global speed) blRect.setRectangle (rectangle:Rectangle) blRect.getNodes ():Array blRect.toString ():String Next Update - Circular paths - more suggestions welcome | Flash game developmentFirst post of the topicExample: Example.as How it works: First you'll need an Array of 'blNode's which have a value of x,y & speed, these are the node locations, Then you'll need a 'blPath', this does the real stuff, this take in your array of nodes, an array of targets (which objects to move), a 'Global Speed' value, & a directioning Boolean (if set to true, the objects will point towards the next node). Once you've created these, then you'll need your own Enter_frame event to make it actually Go... blNodes properties & functions (blNode extends Point): blNode.x:Number blNode.y:Number blNode.speed:uint (0 to 200) blNode.setToPoint(newLocation:Point) blNode.toString():String blPath properties & functions: blPath.nodes:Array blPath.targets:Array blPath.globalSpeed:uint blPath.directiong:Boolean blPath.update() blPath.reverse() blPath.realSpeed() (gets the actual speed of the path, effected by node Speeds) blPath.toString():String blRect (creates 4 blNodes from a rectangle) properties & functions: blRect.setSpeed (nodeToChange:uint, new_Speed:Number) blRect.setGlobalSpeed ( new_GlobalSpeed:Number) (sets all node speeds to the new global speed) blRect.setRectangle (rectangle:Rectangle) blRect.getNodes ():Array blRect.toString ():String Next Update - Circular paths - more suggestions welcome |
-Bug Fixes
-Example project added
-Library layout changed