# jumpTo engine

**URL:** https://forum.kirupa.com/t/jumpto-engine/182214
**Category:** Uncategorized
**Created:** [March 16, 2006, 9:35am UTC](https://forum.kirupa.com/t/jumpto-engine/182214 "2006-03-16T09:35:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![manga](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@manga](https://forum.kirupa.com/u/manga)
#### Post date: [March 16, 2006, 9:35am UTC](https://forum.kirupa.com/t/jumpto-engine/182214/1 "2006-03-16T09:35:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)
#### Post date: [March 18, 2006, 10:17pm UTC](https://forum.kirupa.com/t/jumpto-engine/182214/2 "2006-03-18T22:17:31Z")

</div>

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…  
 ![](http://www.mumu.cz/tmp/jump.gif)

1. You choose random point, as a center of the circle.
2. Calculate radius
3. Find starting position
4. Move fish along its path

Now lets start implementing =)

1. Thats easy 😉
2. In Flash 8, you can just use point class

```auto
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)

```

1. Thats just… well, lets make it possible to jump from both directions

```auto
// 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;

```

1. Sorry, I dont have much time right now, but you should be able to figure the rest by yourself. Look at Sen’s tutorial about 3D here at kirupa… there is a section about trigonometry and about movement on a circle ([link](http://www.kirupa.com/developer/actionscript/trigonometry.htm)) Good luck. If you need something, ill be back later =)

---

<div class="post-metadata">

### Author: ![manga](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@manga](https://forum.kirupa.com/u/manga)
#### Post date: [March 19, 2006, 9:41am UTC](https://forum.kirupa.com/t/jumpto-engine/182214/3 "2006-03-19T09:41:43Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![manga](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@manga](https://forum.kirupa.com/u/manga)
#### Post date: [March 20, 2006, 8:30am UTC](https://forum.kirupa.com/t/jumpto-engine/182214/4 "2006-03-20T08:30:19Z")

</div>

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…
