主要考虑小球与浏览器各个边的碰撞检测(注意小球本身的半径)。
给小球一个x轴,y轴方向的速度,碰撞之后速度取反,颜色改变(用随机数即可)。
还需注意当浏览器窗口改变时,小球边界检测改变。通过window.onresize.
-
Notifications
You must be signed in to change notification settings - Fork 0
ZKJGOLD/collision
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published