Hi,

I have to write a programe for a labyrinth that shows me that the player has made a mistake if he looked in to the direction of a dead end. I wanted to implement it, that if the player is on x,y coords and his pen goes for example 15 < or > -15 than it would count as a mistake.

But the problem is that pen counter never stops - if you rotate in one direction it goes over -+360 to much bigger numbers, and because I can't say how players would move around and rotate I can't really programme it the way I wanted to.

So here is my question: is it possible to specify in the script that pen can be ONLY 0 to 359, so that 360 would be again 0 and -1 would be 359?

my.pan += clamp(my.pan, 0, 359); just gets me an endless rotation...


I would be really greatful for any help!

Cheers

EM