zim编写星星闪耀轨迹运行动画
代码语言:html
所属分类:动画
代码描述:zim编写星星闪耀轨迹运行动画
下面为部分代码预览,完整代码请点击下载或在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 assets = "5ef9112d35118.png"; const path = "http://repo.bfw.wiki/bfwrepo/image/"; const frame = new Frame("fit", 1024, 768, black, black, assets, path); 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 let stage = frame.stage; let stageW = frame.width; let stageH = frame.height; // REFERENCES for ZIM at http://zimjs.com // see http://zimjs.com/learn.html for video and code tutorials // see http://zimjs.com/docs.html for documentation // see https://www.youtube.com/watch?v=pUjHFptXspM for INTRO to ZIM // see https://www.youtube.com/watch?v=v7OT0YrDWiY for INTRO to CODE // CODE HERE const stars = new Container(stageW, stageH).addTo(); loop(6, () => { // create the starts from the start.png spritesheet asset that is 5 cols and 6 rows new Sprite(asset("5ef9112d35118.png"), 5, 6).centerReg(stars).run({ loop: true }); }); // this is where we draw the noise image const shape = new Shape(stageW, stageH).addTo(); // this will hold a copy of the image as we fade out const bmp = new Bitmap().addTo(); // here is our Noise object const noise = new Noise(); const lines = stars.numChildren + 1; // how many lines we will draw const height = 300; // how far up or down the end of the line is allowed to be const step = .006; // the step we will increase for the second param.........完整代码请登录后点击上方下载按钮下载查看
网友评论0