0


烟花代码(本人亲测,有效)

代码如下:

<!DOCTYPE html>
<html>
    <head>
         <meta charset="utf-8" /> 
<meta http-equiv="Content-Type" content="text/html; charset=gbk" /> <title>过年好</title> 
<script type="text/javascript"> 
 
<style>
html,body{
    margin:80px;
    width:100%;
    height:100%;
    overflow:hidden;
    background:#80;
}
 
#canvas{
    width:300%;
    height:300%;
}
</script> 
<style type="text/css">
  .aa
  {
   font: "微软雅黑";
   font-size: 30px;
   color: gold;   
   text-align: center;  
   } 
</style> 
</head>
    
<body style="background:#000;font:12px Arial">
  <p class="aa">新年快乐</p>  
    <audio src="audio/"></audio> 
   } 
<canvas id="canvas" width="1888" height="790"></canvas><script>
function initVars(){
 
    pi=Math.PI;
    ctx=canvas.getContext("2d");
    canvas.width=canvas.clientWidth;
    canvas.height=canvas.clientHeight;
    cx=canvas.width/2;
    cy=canvas.height/2;
    playerZ=-25;
    playerX=playerY=playerVX=playerVY=playerVZ=pitch=yaw=pitchV=yawV=0;
    scale=600;
    seedTimer=0;seedInterval=5,seedLife=100;gravity=.02;
    seeds=new Array();
    sparkPics=new Array();
    s="https://cantelope.org/NYE/";
    for(i=1;i<=10;++i){
        sparkPic=new Image();
        sparkPic.src=s+"spark"+i+".png";
        sparkPics.push(sparkPic);
    }
    sparks=new Array();
    pow1=new Audio(s+"pow1.ogg");
    pow2=new Audio(s+"pow2.ogg");
    pow3=new Audio(s+"pow3.ogg");
    pow4=new Audio(s+"pow4.ogg");
    frames = 0;
}
 
function rasterizePoint(x,y,z){
 
    var p,d;
    x-=playerX;
    y-=playerY;
    z-=playerZ;
    p=Math.atan2(x,z);
    d=Math.sqrt(x*x+z*z);
    x=Math.sin(p-yaw)*d;
    z=Math.cos(p-yaw)*d;
    p=Math.atan2(y,z);
    d=Math.sqrt(y*y+z*z);
    y=Math.sin(p-pitch)*d;
    z=Math.cos(p-pitch)*d;
    var rx1=-1000,ry1=1,rx2&#
标签: 开源

本文转载自: https://blog.csdn.net/Kevin_promax/article/details/128479343
版权归原作者 Kevin_promax 所有, 如有侵权,请联系我们删除。

“烟花代码(本人亲测,有效)”的评论:

还没有评论