hey all,
I wanna make a simple (as possible) jump engine that makes jumps with a curve and at the position of a ring Object _y it jumps higer or lower…
take a look at a demo pic…
ps its a quick and dirty drawing :))
Cheers,
M
hey all,
I wanna make a simple (as possible) jump engine that makes jumps with a curve and at the position of a ring Object _y it jumps higer or lower…
take a look at a demo pic…
ps its a quick and dirty drawing :))
Cheers,
M
So you want that fish tu jump trough a center of a ring, right?
No testing, no guarantee, but anyway here you go:
Lets look at this picture…
Now lets start implementing =)
var circleCenter:Point = new Point(300, 100);
var randPoint:Point = new Point(200, 0);
var radius:Number = Point.distance(circleCenter, randPoint);
// without flash 8 Pythagorean theorem will do
circleCenter = [300,100];
randPoint = [200, 0];
a = circleCenter[0]-randPoint[0];
b = circleCenter[1]-randPoint[1];
radius = Math.sqrt(a*a + b*b)
// flash 8 solution
var startPoint:Point = new Point();
startPoint.x = (circleCenter.x-randPoint.x > 0) ? randPoint.x+radius : randPoint.x-radius;
// non-flash 8
startPoint = (circleCenter[0]-randPoint[0] > 0) ? randPoint[0]+radius : randPoint[0]-radius;
hm thanks but still need some help here…
now i have the starting point…ok… and now i try to move it but what is the angle… i calculate it…
i am also trying to make the fish from startposition the _rotation=0 and i want it to be at the higest point… _rotation= -90 so its rotating along…
i try to make it work…
hm thanks but still need some help here…
now i have the starting point…ok… and now i try to move it but what is the angle… i calculate it…
i am also trying to make the fish from startposition the _rotation=0 and i want it to be at the higest point… _rotation= -90 so its rotating along…
i try to make it work…
:: Copyright KIRUPA 2024 //--