zim鼠标跟随和粒子发射效果

代码语言:html

所属分类:粒子

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">


</head>
<body translate="no">

<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/createjs.min.js"></script>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/zim-min.js"></script>

<script >
const frame = new Frame("fit", 1024, 768, purple, darker);
frame.on("ready", () => {
  zog("ready from ZIM Frame"); // logs in console (F12 - choose console)

  // often need below - so consider it part of the template
  const stage = frame.stage;
  const stageW = frame.width;
  const stageH = frame.height;

  // REFERENCES for ZIM at https://zimjs.com
  // see https://zimjs.com/intro.html for an intro example
  // see https://zimjs.com/learn.html for video and code tutorials
  // see https://zimjs.com/docs.html for documentation

  // CODE HERE

  // MotionController has many types:
  // set to "mousemove" to have the target follow the mouse movement
  // set to "pressmove" to have target jump to mousedown position then follow while pressing
  // set to "pressdrag" to have target follow mouse if pressed on and then dragged (dedicated to Shan Ruan)
  // set to "keydown" to use keys to control the target (see map parameter)
  // set to "gamebutton" to use gamepad buttons to control the target (see map parameter)
  // set to "gamestick" to use gamepad stick(s) to control the target (see map parameter)
  // set to "swipe" to use swipe to control the target
  // set to "follow" to mousedown and hold and use Frame.follow() to keep moving towards mouse or press position
  // set to "manual" to set your own with myController.convert() or myController.x and myController.y pro.........完整代码请登录后点击上方下载按钮下载查看

网友评论0