+ 1

Why won’t the circle move on the canvas?

I have clipped an image onto an arc element in the canvas. The image appears alright, but when I go to animate it, only the image inside it moves and not the actual circle. I want the circle to move, but not the image. I’m incrementing the x position of the circle, but it still doesn’t move, only the image, and I haven’t yet been able to figure it why. If anyone has any insight into why this is happening and possibly a solution, that would be very much appreciated. https://code.sololearn.com/WHxJyH1fuj10/?ref=app

16th Feb 2019, 8:30 PM
Thomas Czernek
Thomas Czernek - avatar
3 Antworten
+ 1
You should use an svg object within your canvas so you can movie it. Example code here. https://code.sololearn.com/WMc8Um36CFCI/?ref=app
18th Feb 2019, 3:42 AM
Adam Schmitt
Adam Schmitt - avatar
+ 1
thanks for the tip. I had heard of svg but wasnt sure what it was, only that it cant be used to make a whole game. but i guess it can be used for parts. by the way, thats an awesome game you made there
18th Feb 2019, 4:05 AM
Thomas Czernek
Thomas Czernek - avatar
0
Thanks, I had fun with that one, but now thinking about what my next project should be.
19th Feb 2019, 2:16 AM
Adam Schmitt
Adam Schmitt - avatar