Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Akow, 1 invisible), 1,423 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to make entity2 move around entity1? #324613
05/22/10 09:57
05/22/10 09:57
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
Hi!

how do i do this:



How do I make entity2 pan around entity1, when entity1 is paning?

thanks

- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: how to make entity2 move around entity1? [Re: Muhsin] #324615
05/22/10 10:14
05/22/10 10:14
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
ent2.x = ent1.x-256*sin(ent1.pan);
ent2.y = ent1.y-256*cos(ent1.pan);
// ent2.pan = ent1.pan; // remove the comment if you like to

Alternatively you can use vec_rotate.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: how to make entity2 move around entity1? [Re: Superku] #324618
05/22/10 10:21
05/22/10 10:21
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
thanks, it works!

- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: how to make entity2 move around entity1? [Re: Muhsin] #324714
05/22/10 20:00
05/22/10 20:00
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
I got another question:

how can I choose a specific position for entity2, so it still moves around entity1 and is, lets say 50 quants back and 150 quants left of entity1, if you understand?

thanks!

- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: how to make entity2 move around entity1? [Re: Muhsin] #324716
05/22/10 20:02
05/22/10 20:02
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
var extra_ang = 20;
var distance = 200;
ent2.x = ent1.x-distance *sin(ent1.pan + extra_ang );
ent2.y = ent1.y-distance *cos(ent1.pan + extra_ang );

Last edited by Quadraxas; 05/22/10 20:03.

3333333333
Re: how to make entity2 move around entity1? [Re: Quad] #324721
05/22/10 20:41
05/22/10 20:41
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"how can I choose a specific position for entity2, so it still moves around entity1 and is, lets say 50 quants back and 150 quants left of entity1, if you understand?"


As I've said before, use vec_rotate:

vec_set(ent2.x,vector(-50,150,0));
vec_rotate(ent2.x,ent1.pan);
vec_add(ent2.x,ent1.x);


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: how to make entity2 move around entity1? [Re: Superku] #324726
05/22/10 21:09
05/22/10 21:09
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
Thanks for the answers!

I tried out Quadraxes answer, and it worked.

Thanks!

- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1