Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question about angle functions #442502
06/23/14 22:13
06/23/14 22:13
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Hi guys I need help.
I want to create an ball (with ent_create function) from vector A position. Then I want move this ball to the vector B. My question is, how can I tell that the ball it move toward to the vector B?

Re: Question about angle functions [Re: LawnmowerMan] #442503
06/23/14 22:22
06/23/14 22:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Easy way:
Change pan as follows
vec_diff(temp, B, A);
vec_to_angle(ball.pan,temp);
and then c_move using the first speed parameter.


"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: Question about angle functions [Re: Superku] #442506
06/23/14 23:02
06/23/14 23:02
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Thanks for answer. I do not know where I wrong, but my ball fly in wrong way

Code:
action cannon_ball(){
	set(my,PASSABLE);
	my.speed_x = 8;
	VECTOR temp2;
	while(1){
	        vec_for_vertex(temp2,cannon,43);
	        vec_diff(temp, player.x, temp2);
		vec_to_angle(my.pan,temp);
		c_move(my,temp2,my.speed_x,IGNORE_PASSABLE);
		wait(1);	
	}
}


Re: Question about angle functions [Re: LawnmowerMan] #442508
06/23/14 23:07
06/23/14 23:07
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
c_move(my,temp2,my.speed_x,IGNORE_PASSABLE);
This does not make much sense to me. Check the manual reference for c_move, you are giving a world position (temp2) as the relative speed vector.
Try sth as follows:

Code:
action cannon_ball(){
	set(my,PASSABLE);
	my.speed_x = 8;
	vec_for_vertex(my.x,cannon,43);
	vec_diff(temp, player.x, my.x);
	vec_to_angle(my.pan,temp);
	while(1){
		c_move(my,vector(my.speed_x*time_step,0,0),nullvector,IGNORE_PASSABLE);
		wait(1);	
	}
}



"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: Question about angle functions [Re: Superku] #442509
06/23/14 23:27
06/23/14 23:27
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Ah, now I understand. Thank you man!


Gamestudio download | 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