Angle problem

Non-platform specific questions.

Angle problem

Postby tom.drin » Tue May 17, 2005 5:51 pm

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
tom.drin
 
Posts: 13
Joined: Fri May 06, 2005 10:08 pm
Score: 0 Give a positive score

Postby makslane » Wed May 18, 2005 1:10 pm

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);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby tom.drin » Wed May 18, 2005 3:49 pm

Thank you, I will try it.
tom.drin
 
Posts: 13
Joined: Fri May 06, 2005 10:08 pm
Score: 0 Give a positive score

Postby tom.drin » Wed May 18, 2005 4:06 pm

Is there some possibility to get absolute position of actor, if he has got a parent? something like: x.absolute?
tom.drin
 
Posts: 13
Joined: Fri May 06, 2005 10:08 pm
Score: 0 Give a positive score

Postby makslane » Fri May 20, 2005 12:23 pm

x + parent.x will works if the parent actor has no parent
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest