最赞回答 / Jeff_子豪
function update(){ ball.x += ball.vx; ball.y += ball.vy; ball.vy += ball.g; if(ball.y>=768){ //加上这一句,就可以重复运动了 ball = {x:512,y:100,r:20,g:2,vx:-4,vy:0,color:"#005588"} } }
2016-01-05
最新回答 / endenvor
你试试我这个,JS代码,其他的都一样,你自己弄就行:var WINDOW_WIDTH = 1388;var WINDOW_HEIGHT = 768;var RADIUS = 8;var MARGIN_TOP = 270;var MARGIN_LEFT = 10;var MARGIN_TOP_YEAR = 50;// var curShowTimeSeconds = 0;var balls = [];const colors = ["#33B5E5", "#0099CC", "#AA66CC", "#993...
2016-01-05
最新回答 / qq_謸嬌尒攋攋_0
function draw(piece,cxt){ cxt.beginPath(); cxt.moveTo(piece.p[0].x,piece.p[0].y);//起点 for(var i=1;i<piece.p.length;i++) cxt.lineTo(piece.p[i].x,piece.p[i].y); cxt.closePath(); cx...
2015-12-18