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
Maus Navigation #230258
10/04/08 08:38
10/04/08 08:38
Joined: Sep 2007
Posts: 28
C
craik Offline OP
Newbie
craik  Offline OP
Newbie
C

Joined: Sep 2007
Posts: 28
Hallo, ich bräuchte einen denkanstoss oder vlt. ein tutorial zum folgendem thema, also ich habe ein Schiff und dieses soll automatisch dahin fahren wo ich mit der Maus auf das Wasser klicke.
So ich habe auch schon etwas Programmiert das sich das schiff der maus zu wendet das problem dabei ist aber das sich das schiff natürlich ruckartig dreht also nicht langsam.
Click to reveal..

function set_target()
{
var pos1;
var pos2;
pos1.x = mouse_pos.x;
pos1.y = mouse_pos.y;
pos1.z = 0;
vec_for_screen (pos1, camera);
pos2.x = mouse_pos.x;
pos2.y = mouse_pos.y;
pos2.z = 1000; // use a big value here
vec_for_screen (pos2, camera);
trace (pos1, pos2); // now "target" holds the coordinates of the hit point

draw_point3d(target,vector(0,0,255),100,50);
}


function rotate_to_mouse()
{
vec_set(temp,vector(mouse_pos.x,mouse_pos.y,5000));
vec_for_screen(temp,camera);//world cood
c_trace(camera.x,temp,ignore_passable);
vec_set(temp,target.x);
vec_sub(temp,fisch.x);
vec_to_angle(temp,temp);//now points from me to mousepos
fisch.pan = temp.x;
}


ausserdem ist das schiff ja etwas träge, deshalb darf es sich ja nicht zu schnell drehen

Last edited by craik; 10/04/08 08:39.
Re: Maus Navigation [Re: craik] #230273
10/04/08 11:47
10/04/08 11:47
Joined: Sep 2007
Posts: 28
C
craik Offline OP
Newbie
craik  Offline OP
Newbie
C

Joined: Sep 2007
Posts: 28
keiner eine ahnung?


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