hi all. This might be more of a math problem then anything, but i'll give it a shot. I have an idea for a game i am working on, in which the player must advanced thru a level my the means of propelling a cube in the air (across the level and around barriers). The way this is done, is the player clicks on anywhere on the screen, and the cube is propelled in the direction of the angle between the player and the mouse position. here's a picture that attempts to explain it. So pretty much, i have a function return_cube_slope(mpos,obj_pos), that returns the slope for the cube:

``````def dist(p1,p2):
# returns the distance (length of the line)
return math.sqrt( (p2-p1)**2+(p2-p1)**2 )

def return_cube_slope(mpos,obj_pos):
# velocity for how fast the cube will move
velocity = 3
l1 = dist(obj_pos,mpos)                           # hypotenus
You could use cmath.phase which returns the phase of a complex number in -pi, + pi. Note the equivalent `math.atan2(y, x)` for the phase of the point (x, y).