Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / getspriteangle gives inconsistent values

Author
Message
Duncro
9
Years of Service
User Offline
Joined: 25th Jul 2015
Location:
Posted: 29th Aug 2015 22:40
Hi

When using "getspriteangle" it swaps between a cumulative and a 360° angle, depending on if it was set recently. Eg.

print(str(GetSpriteAngle(player)))
SetSpriteAngle(player,GetSpriteAngle(player)-maxrotation)
print(str(GetSpriteAngle(player)))

returns
-30
330

when angled 30° to the left.

Any fix for this?

Regards
Duncan
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 30th Aug 2015 00:57
if myAngle# < 0 then inc myAngle#, 360

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Duncro
9
Years of Service
User Offline
Joined: 25th Jul 2015
Location:
Posted: 30th Aug 2015 17:38
Thanks, im already using a work around for it using setspriteangle(sprite,getspriteangle(sprite)), just wanted to know if there is a way to stop it from doing this.

Thanks anyways

Login to post a reply

Server time is: 2024-11-23 10:47:55
Your offset time is: 2024-11-23 10:47:55