by Kidpaddle45
Create a compass on-screen and have it point in a direction based on your target's position on map. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Kidpaddle45.Compas##version=0

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:


Latest Version
Date added: Oct 6 2013
Last updated: Oct 9 2013
15 fans

Requires BYOND V.500+

Can be used freely, no credits required. (Knowing where it's used would be cool!)

Just like in MMORPGs:


PopLava: (Feb 27, 7:25 pm)
FYI: Compass isn't moving in latest version of BYOND.
Kaiochao: (Oct 22 2013, 9:00 am)
I was being nitpicky and referring to turn(Icon, Angle). My mistake.

I forgot turn() is used for matrices too, ever since I started using matrix(Angle, MATRIX_ROTATE).
Airjoe: (Oct 22 2013, 8:54 am)
I'm not so familiar with all this new stuff, but how is BYOND's built-in `turn` procedure not used in the call to `animate`? Or are you just being nitpicky and acting as if "BYOND's `turn`" only refers to `turn(Dir, Angle)` and not also to `turn(Matrix, Angle)`? I thought it was pretty clear what I was asking.
Kaiochao: (Oct 22 2013, 8:44 am)
Neither BYOND's turn() nor icon.Turn() are used in this example, although I'm not sure if they round their angles.

I remember Lummox claiming that matrix rotation (which is used in this example), unlike icon.Turn(), does support floats. They don't need to be in [0, 360), either.
Airjoe: (Oct 22 2013, 7:58 am)
Ok, I got you, thanks. I wasn't sure what you meant with regards to "need to keep the angle in any bounds".

OP's code is already rounding to the nearest 1, so my proposed change doesn't affect the end result.

Does BYOND's `turn` procedure accept floats for an angle?