最贊回答 / 三3心
在drawStarTwo函數中,把cxt.translate(x, y)放在cxt.rotate(rot / 180 * Math.PI);之前,就可以了。
2016-08-04
最新回答 / Char_n
??for(var i=0;i<200;i++){ ? ? ? ? //利用json來創(chuàng)建200個隨機星星var aStar={? ? ? ? ? ? ? ?x:Math.random()*canvas.width,? ? ? ? ? ? ? ?y:Math.random()*canvas.height,? ? ? ? ? ? ? ?R:Math.random()*5+5,? ? ? ? ? ? ? ?a:Math.random()*360};? ? ? ? ? ?if(stars.length==...
2016-07-31
最贊回答 / GD_sun粉
這個代碼,你寫錯了,這兒應該是y, var y=event.clientY-canvas.getBoundingClientRect().top; ?
2016-07-21
最新回答 / ttwhy
通過setInterval不停改變星星的opacity可以實現閃爍。用老師之前講的?setInterval(function(){???? render(context);???? update();??? },200)這個方法。不間斷繪制及改變底層參數。
2016-06-30