Page 1 of 1

Angle problem

PostPosted: Tue May 17, 2005 5:51 pm
by tom.drin
Hi,
I have big problem:
I'm using angle=direction(pwire.x,pwire.y,xmouse,ymouse); and diretional_velocity=15; to move a bullet. //pwire is a player
But it's not working, bullet is moving toward the game center(I think).
I was using a xscreen instead of pwire.x and yscreen....and it works well, but now it's not enought for my ideas.
Image

PostPosted: Wed May 18, 2005 1:10 pm
by makslane
You must use coordinates in the same level.
To use xmouse, ymouse (mouse coordinates relative to screen) you must use the actor coordinates relative to screen.

So, the follow code must work:
angle=direction(pwire.xscreen, pwire.yscreen, xmouse, ymouse);

PostPosted: Wed May 18, 2005 3:49 pm
by tom.drin
Thank you, I will try it.

PostPosted: Wed May 18, 2005 4:06 pm
by tom.drin
Is there some possibility to get absolute position of actor, if he has got a parent? something like: x.absolute?

PostPosted: Fri May 20, 2005 12:23 pm
by makslane
x + parent.x will works if the parent actor has no parent