0
Website opening animation using javascript....
Hey guys I need a source code to make my own opening website animation.( is more like an alert animation that shows when you open the website .) I want it to be a fork rolling a spaghetti. Pls guys I really need help with that....😥😥😥😥
2 Respostas
+ 1
That would be kind of hard to do on sololearn because you don't have the ability to download/make sprites on this editor. I would recommend downloading a different editor with the ability to make sprites. Then, you could use the code:
Sprite.prototype.draw = function (ctx, x ,y) {
if (this.angle == 0) {
ctx.drawImage(this.img, this.x, this.y, this.width, this.height, x, y, this.width, this.height);
}
else {
ctx.save();
ctx.translate(x, y);
ctx.rotate(this.angle * this._TORADIANS);
ctx.drawImage(this.img, this.x, this.y, this.width, this.height, x, y, this.width, this.height);
ctx.restore();
}
}
0
Thanks man