Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_target_angle(tmpTarX,tmpTarY,tmpMyX=self.x,tmpMyY=self.y)
- return 0 if tmpMyX == tmpTarX && tmpMyY == tmpTarY
- tmpAngle = Math.atan2(tmpMyX - tmpTarX, tmpMyY - tmpTarY)
- tmpAngle = tmpAngle * (180 / Math::PI)
- tmpAngle +=360 if tmpAngle < 0
- tmpAngle = tmpAngle.round
- tmpAngle
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement