|
Post by tsh73 on Feb 9, 2023 19:46:38 GMT
I struggled with rotation today I looks at code and saw it rotate depending on X change But it rotates in mouse direction if mouse is above sprite center, but in opposite direction if mouse is under center
This mod rotates in the same direction as mouse goes, above and under sprite center
[rotate] newx=MouseX dir=0 'stay still if y<o(ob,oY)+o(ob,oH)/2 then if newx>oldx+5 then dir=1 : oldx=newx'rotate right if newx<oldx-5 then dir=-1 :oldx=newx 'rotate left else if newx>oldx+5 then dir=-1 : oldx=newx'rotate right if newx<oldx-5 then dir=1 :oldx=newx 'rotate left end if
|
|