So one possible solution could be to keep track of an offset dx,dy from the object’s xy to rotate around. Initially you’d set that to wherever on the layout minus the sprites position. Then after that you’d update it with a helper function.
Number rx=0
Number ry=0
Function vrotate(x,y,a)
— set rx to x*cos(a)-y*sin(a)
— set ry to x*sin(a)+y*cos(a)
Function rotateSprite(u, a)
Pick sprite by uid u
— sprite: set position to self.x+self.dx, self.y+self.dy
— sprite: rotate a degrees clockwise
— call vrotate(sprite.dx, sprite.dy, a)
— sprite: set dx to rx
— sprite: set dy to ry
— sprite: set position to self.x-self.dx, self.y-self.dy
Sorry R0J0hound, I did not understand, you're really smart. I haven't even fully understood what sine and cosine are yet. I tried the first method you described but failed.
I fixed my game like WackyToaster and I said, but your method seems more ingenious and complex and intrigues me.
I don't understand if you mean to use the DrawingCanvas object, which was my initial idea.
I insert the link of my c3p file, can you download it and fix it so that it works? Or create another example project?
I don't understand what dx and dy are (what the "d" stands for)
If you have time, explain to me again. Thank you.
https://drive.google.com/file/d/1V36YNEgNkuSidA7mkMcSAoG6usq265jU/view?usp=drive_link