Friday, 15 July 2011

actionscript 3 - game - how can I drag objects (cars with numbers) into targets (start line) AS3.0.? -



actionscript 3 - game - how can I drag objects (cars with numbers) into targets (start line) AS3.0.? -

i having problem, have several cars, numbers , letters, , need set 5 cars in starting places. -random order ok.

i' having problem finding in as3 way endx , endy of each object can in starting lines , considered right no matter order!

i'm having problem putting code here so, heres titanpad code:

this code: beingness (um, dois, tres, quatro) movieclip instance name each numbered car. https://titanpad.com/42vtncbvlu

first of all, benefit using distance between 2 points formula , seeing if distance less value rather checking in 4 directions manually:

math.abs(math.sqrt((x2-x1)^2 + (y2-y1)^2))

let position of auto (x1,y1) , start position (x2,y2). formula give distance between 2 points in direction, , test maybe whether value less offset.

as cars in order part, i'm interpreting have cars , want user drag them 1 of 5 spots, bit this:

spot1

spot2

spot3

spot4

spot5

all respective coordinates. suggestion have boolean flag whether each spot occupied stops programme checking whether auto set there after has been taken once. 1 time these flags true, can proceed.

hope helps.

actionscript-3 drag-and-drop adobe flash-cs6

No comments:

Post a Comment