zim实现一个canvas拼图游戏

代码语言:html

所属分类:游戏

代码描述:zim实现一个canvas拼图游戏

代码标签: canvas 拼图 游戏

下面为部分代码预览,完整代码请点击下载或在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-1.3.2.js"></script>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/zim-cat.js"></script>
<script >
const frame = new Frame("fit", 1024, 768, green, dark, "5d65ea7d8bc8b.png", "http://repo.bfw.wiki/bfwrepo/image/");
frame.on("ready", () => {// ES6 Arrow Function - similar to function(){}
  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
  // see https://codepen.io/topic/zim/ for ZIM on CodePen

  // CODE HERE

  const thumbs = [];
  const cols = 3;
  const rows = 3;

  const image = asset("5d65ea7d8bc8b.png");
  const w = image.width / cols;
  const h = image.height / rows;

  //.........完整代码请登录后点击上方下载按钮下载查看

网友评论0