<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>"小球连线动画"</title>
<script type="text/javascript" src="https://code.createjs.com/1.0.0/createjs.min.js"></script>
</head>
<body>
<canvas id="canvas"></canvas>
<script>
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
const width = canvas.width = window.innerWidth;
const height = canvas.height = window.innerHeight;
class Ball {
constructor(x, y, velX, velY, color, size) {
this.x = x;
this.y = y;
this.velX = velX;
this.velY = velY;
this.color = color;
this.size = size;
HTML小球连线动画
于 2023-11-23 10:53:49 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)