3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Question about angle functions
[Re: Superku]
#442506
06/23/14 23:02
06/23/14 23:02
|
Joined: Jun 2010
Posts: 71
LawnmowerMan
OP
Junior Member
|
OP
Junior Member
Joined: Jun 2010
Posts: 71
|
Thanks for answer. I do not know where I wrong, but my ball fly in wrong way
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
Senior Expert
|
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:
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|