p5实现点击花朵分布排列效果代码

代码语言:html

所属分类:其他

代码描述:p5实现点击花朵分布排列效果代码

代码标签: p5 点击 花朵 分布 排列

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

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  


  
  
<style>
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
}
</style>


  
  
</head>

<body translate="no">
  


<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5.1.4.0.js"></script>
      <script >


let fawnlilies = []
let p
let b = 100
function preload(){
  for(let i = 1;i<=6;i++){
    fawnlilies[i-1] = loadImage('//repo.bfw.wiki/bfwrepo/images/skull/Fl'+str(i)+'.png');
  }
}
function setup(){
  createCanvas(windowWidth,windowHeight);
  t = floor(random(0,5.999));
  background(100,200,100)
  noLoop()
  angleMode(DEGREES)
   cnt = 0
  p = floor(random(0,2.99))
  
}
function draw(){
  translate(width/2,height/2)
  compositions(p)
  

  
}

function compositions(n){
  if(n===0){
    for (let i = 0;i<100;i++){
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0