()
| 9 | |
| 10 | //making animation smooth with preload |
| 11 | const preloadImages = () => { |
| 12 | for (let i = 1; i < frameCount; i++) { |
| 13 | const img = new Image(); |
| 14 | img.src = currentFrame(i); |
| 15 | } |
| 16 | }; |
| 17 | |
| 18 | const frameCount=148; //as apple has thismuch of images |
| 19 | canvas.width=1158; |