Discord
Login
Community
DARK THEME

atan2d in python

I'm doing a top-down dungeon game using the mouse direction to shoot, i've seen that someone have used, in microScript, the atan2d function, but in python the console result me the error "name 'atan2d' is not defined, in file "player"", and i can't even import the numpy library. How can I fix?

In Python you could use the function atan2 from module math:

import math

...

angle = math.atan2(y,x)

The result will be in radians, not in degrees (atan2d in microScript gives the angle in degrees, hence the d suffix)

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community