canvas

document.querySelector()
canvas.width canvas.height
canvas.getContext('2d')

状态
context.moveTo(x,y)
context.lineTo(x,y) --- context.lineWidth
context.arc(x,y,r,startAngle,endAngle,anticlockwise)

绘制
context.stroke() --- context.strokeStyle
context.fill() --- context.fillStyle

context.beginPath() //只调用这个就可以不封闭了 没必要成对调用
context.closePath() //会自动把收尾项链 ,对于fill()其实没有什么卵用

 

物理学结合代码 加速度、位移

 

posted @ 2015-06-10 11:14  深海懒猫  阅读(118)  评论(0编辑  收藏  举报