Look at this post in my website (it's translated by google), that's what I'm talking about, see the screens
![Smile :)](./images/smilies/icon_smile.gif)
http://translate.google.com/translate?u ... n&ie=UTF-8
Code: Select all
IMAGE_MIDDLE_X = PLAYER_SCREEN_POS_X + sin(self.player_yaw+YAW_DELTA)*CROSSHAIR_DIST;
IMAGE_MIDDLE_Y = PLAYER_SCREEN_POS_Y + cos(self.player_yaw+YAW_DELTA)*CROSSHAIR_DIST;
IMAGE_TOPLEFT_X = StringCopy(IMAGE_MIDDLE_X) - IMAGE_SIZE_X_HALF;
IMAGE_TOPLEFT_Y = StringCopy(IMAGE_MIDDLE_Y) - IMAGE_SIZE_Y_HALF;
Code: Select all
[Isometric]
; camera height above ground (in texels)
; auto adjusts height to current player actor
height = auto
; angle (in degrees) of camera above horizontal
angleup = 89.9
; angle (in degrees) of camera from directly behind
anglearound = 0
; distance (in texels) of camera from player
distance = 350
; if true the camera will move in/out to avoid obsticles
collisiondetection = true
Code: Select all
{
deltaX [0]
deltaY [0]
angle [0]
Spawn[ ()
{
LowLevel("setup");
} ]
setup[ ()
{
PawnRender(false);
MouseControlledPlayer(false);
think = "run";
} ]
run[ ()
{
deltaX = GetEntityScreenX("Player") - GetMousePosX();
deltaY = GetEntityScreenY("Player") - GetMousePosY();
if(deltaY = 0)
{
deltaY = deltaY + 0.1;
}
if(deltaY > 0)
{
angle = atan(deltaX / deltaY) / 0.0174532925199433 + 180;
}
else
{
angle = atan(deltaX / deltaY) / 0.0174532925199433;
}
DrawFlipBookImage("crosshair",0,GetMousePosX()-16,GetMousePosY()-16,255,0,0,0,1);
SetEntityRotation("Player",0,angle,0);
} ]
}
Code: Select all
DrawFlipBookImage("crosshair",0,GetMousePosX()-XX,GetMousePosY()-YY,255,0,0,0,1);
Code: Select all
if(deltaY > 0)
{
angle = atan(deltaX / deltaY) / 0.0174532925199433 + 180;
}
else
{
angle = atan(deltaX / deltaY) / 0.0174532925199433;
}
and the crosshair is not displayed.run 14/10 atan Method not found
Code: Select all
DrawFlipBookImage("crosshair",0,GetMousePosX()-16,GetMousePosY()-16,255,0,0,0,1);
Code: Select all
DrawFlipBookImage("crosshair",0,GetMousePosX()-90,GetMousePosY()-90,255,0,0,0,1);
Code: Select all
angle = atan(deltaX / deltaY) / 0.0174532925199433 + 180;
Then it should be:because my flipbook image is 90X90.
Code: Select all
DrawFlipBookImage("crosshair",0,GetMousePosX()-45,GetMousePosY()-45,255,0,0,0,1);
That's just the conversion from radians to degrees. The digits are there so the value is exact enough.and why there are so many digits here, I got a little confused