java烟花源代码下载 python炫酷烟花源代码

2022年跨年烟花代码可复制烟花代码如下:
package love;
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.net.URL;
import java.util.Random;
烟花
@author enjoy
@SuppressWarnings("serial")
public class Q extends Applet implements Runnable
public int speed, variability, Max_Number, Max_Energy, Max_Patch,
Max_Length, G;
public String sound;
private int width, height;
private Thread thread = null;
private BeaClassDemo bcd[];
public void init()
int i;
this.setSize(1900, 900);
width = getSize().width - 1;
height = getSize().height - 1;
speed = 1;// 烟花绽放的速度
variability = 10;
Max_Number = 980;// 可发出烟花的最大数目
Max_Energy = width50;
Max_Patch = 90;// 最大的斑点数
Max_Length = 90;// 斑点的最大距离
G = 150;// 向地面弯曲的力度
bcd = new BeaClassDemo[Max_Number];
for (i = 0; iMax_Number; i)
bcd[i] = new BeaClassDemo(width, height, G);
}
public void start() {
if (thread == null) {
thread = new Thread(this);
thread.start();
}
}
@SuppressWarnings("deprecation")
public void stop() {
if (thread != null) {
thread.stop();
thread = null;
}
}
@SuppressWarnings({ "unused", "static-access" })
public void run() {
int i;
int E = (int) (Math.random() * Max_Energy * 3 / 4)Max_Energy / 41;
int P = (int) (Math.random() * Max_Patch * 3 / 4)// 烟花的斑点数
Max_Patch / 41;
int L = (int) (Math.random() * Max_Length * 3 / 4)// 烟花可发射出的距离
Max_Length / 41;
long S = (long) (Math.random() * 10000);
boolean sleep;
Graphics g = getGraphics();
URL u = null;
while (true) {
try {
thread.sleep(1000 / speed);
catch (InterruptedException x) {
sleep = true;
for (i = 0; iMax_Number; i)
sleep = sleepbcd[i].sleep;
if (sleepMath.random() * 100variability) {
E = (int) (Math.random() * Max_Energy * 3 / 4)Max_Energy / 4
1;
P = (int) (Math.random() * Max_Patch * 3 / 4)Max_Patch / 4
1;
L = (int) (Math.random() * Max_Length * 3 / 4)Max_Length / 4
1;
S = (long) (Math.random() * 10000);
for (i = 0; iMax_Number; i) {
if (bcd[i].sleepMath.random() * Max_Number * L1)
bcd[i].init(E, P, L, S);
bcd[i].start();
bcd[i].show(g);
public void paint(Graphics g)
g.setColor(Color.black);
g.fillRect(0, 0, width1, height1);
class BeaClassDemo
public boolean sleep = true;
private int energy, patch, length, width, height, G, Xx, Xy, Ex[], Ey[], x,
y, Red, Blue, Green, t;
private Random random;
public BeaClassDemo(int a, int b, int g)
width = a;
height = b;
G = g;
public void init(int e, int p, int l, long seed)
int i;
energy = e;
patch = p;
length = l;
// 创建一个带种子的随机数生成器
random = new Random(seed);
Ex = new int[patch];
Ey = new int[patch];
Red = (int) (random.nextDouble() * 128)128;
Blue = (int) (random.nextDouble() * 128)128;
Green = (int) (random.nextDouble() * 128)128;
Xx = (int) (Math.random() * width / 2)width / 4;
Xy = (int) (Math.random() * height / 2)height / 4;
for (i = 0; ipatch; i) {
Ex[i] = (int) (Math.random() * energy) - energy / 2;
Ey[i] = (int) (Math.random() * energy * 7 / 8) - energy / 8;
public void start
t = 0;
sleep = false;
public void show(Graphics g)
if (!sleep)
if (tlength)
int i, c;
double s;
Color color;
c = (int) (random.nextDouble() * 64) - 32Red;
if (c = 0c256)
Red = c;
c = (int) (random.nextDouble() * 64) - 32Blue;
if (c = 0c256)
Blue = c;
c = (int) (random.nextDouble() * 64) - 32Green;
if (c = 0c256)
Green = c;
color = new Color(Red, Blue, Green);
for (i = 0; ipatch; i)
s = (double) t / 100;
x = (int) (Ex[i] * s);
y = (int) (Ey[i] * s - G * s * s);
g.setColor(color);
g.drawLine(Xxx, Xy - y, Xxx, Xy - y);
if (t = length / 2)
int j;
for (j = 0; j2; j)
s = (double) ((t - length / 2) * 2j) / 100;
x = (int) (Ex[i] * s);
y = (int) (Ey[i] * s - G * s * s);
g.setColor(Color.black);
g.drawLine(Xxx, Xy - y, Xxx, Xy - y);
常用的编程语言 。
编程语言一:C语言
C语言是世界上最流行、使用最广泛的高级程序设计语言之一 。在操作系统和系统使用程序以及需要对硬件进行操作的场合,用C语言明显优于其它高级语言,许多大型应用软件都是用C语言编写的 。
编程语言二:java
Java是一种可以撰写跨平台应用软件的面向对象的程序设计语言 , 是由Sun Microsystems公司于1995年5月推出的Java程序设计语言和Java平台(即JavaSE, JavaEE, JavaME)的总称 。
编程语言三:c
C这个词在中国大陆的程序员圈子中通常被读做“C加加”,而西方的程序员通常读做“C plus plus" , "CPP” 。它是一种使用非常广泛的计算机编程语言 。C是一种静态数据类型检查的、支持多重编程范式的通用程序设计语言 。
求这个网页的java appletimport java.applet.Applet;
import java.applet.AudioClip;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Event;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.MemoryImageSource;
import java.util.Random;
public class jhanabi extends Applet
implements Runnable
{
private int m_nAppX;
private int m_nAppY;
private int m_centerX;
private int m_centerY;
private int m_mouseX = 0;
private int m_mouseY = 0;
private int m_sleepTime = 5;
private boolean isError = false;
private boolean m_isPaintFinished;
boolean isRunning;
boolean isInitialized = false;
Thread runner;
int[] pix0;
MemoryImageSource offImage;
Image dbImg;
int pixls;
int pixls2;
Random rand = new Random();
int bits = 10000;
double[] bit_px = new double[this.bits];
double[] bit_py = new double[this.bits];
double[] bit_vx = new double[this.bits];
double[] bit_vy = new double[this.bits];
int[] bit_sx = new int[this.bits];
int[] bit_sy = new int[this.bits];
int[] bit_l = new int[this.bits];
int[] bit_f = new int[this.bits];
int[] bit_p = new int[this.bits];
int[] bit_c = new int[this.bits];
int bit_max;
int bit_sound;
int ru = 50;
int rv = 50;
AudioClip sound1;
AudioClip sound2;
public void init()
{
String str = super.getParameter("para_bits"); if (str != null) this.bits = Integer.parseInt(str);
str = super.getParameter("para_max"); if (str != null) this.bit_max = Integer.parseInt(str);
str = super.getParameter("para_blendx"); if (str != null) this.ru = Integer.parseInt(str);
str = super.getParameter("para_blendy"); if (str != null) this.rv = Integer.parseInt(str);
str = super.getParameter("para_sound"); if (str != null) this.bit_sound = Integer.parseInt(str);
this.m_nAppX = super.size().width;
this.m_nAppY = super.size().height;
this.m_centerX = (this.m_nAppX / 2);
this.m_centerY = (this.m_nAppY / 2);
this.m_mouseX = this.m_centerX;
this.m_mouseY = this.m_centerY;
super.resize(this.m_nAppX, this.m_nAppY);
this.pixls = (this.m_nAppX * this.m_nAppY);
this.pixls2 = (this.pixls - (this.m_nAppX * 2));
this.pix0 = new int[this.pixls];
this.offImage = new MemoryImageSource(this.m_nAppX, this.m_nAppY, this.pix0, 0, this.m_nAppX);
this.offImage.setAnimated(true);
this.dbImg = super.createImage(this.offImage);
for (int i = 0; ithis.pixls;i) {
this.pix0[i] = -16777216;
}
this.sound1 = super.getAudioClip(super.getDocumentBase(), "firework.au");
this.sound2 = super.getAudioClip(super.getDocumentBase(), "syu.au");
for (int j = 0; jthis.bits;j) {
this.bit_f[j] = 0;
}
this.isInitialized = true;
start();
}
public void run()
{
while (!(this.isInitialized)) try {
Thread.sleep(200L);
}
catch (InterruptedException localInterruptedException1)
{
}
while (true) {
for (int j = 0; jthis.pixls2;j)
{
int k = this.pix0[j];
int l = this.pix0[(j1)];
int i1 = this.pix0[(jthis.m_nAppX)];
int i2 = this.pix0[(jthis.m_nAppX1)];
int i = (k0xFF0000)16;
int i3 = ((((l0xFF0000)16) - i) * this.ru8)i;
i = (k0xFF00)8;
int i4 = ((((l0xFF00)8) - i) * this.ru8)i;
i = k0xFF;
int i5 = (((l0xFF) - i) * this.ru8)i;
i = (i10xFF0000)16;
int i6 = ((((i20xFF0000)16) - i) * this.ru8)i;
i = (i10xFF00)8;
int i7 = ((((i20xFF00)8) - i) * this.ru8)i;
i = i10xFF;
int i8 = (((i20xFF) - i) * this.ru8)i;
int i9 = ((i6 - i3) * this.rv8)i3;
int i10 = ((i7 - i4) * this.rv8)i4;
int i11 = ((i8 - i5) * this.rv8)i5;
this.pix0[j] = (i916 | i108 | i11 | 0xFF000000);
}
rend();
this.offImage.newPixels(0, 0, this.m_nAppX, this.m_nAppY);
try {
Thread.sleep(this.m_sleepTime);
}
catch (InterruptedException localInterruptedException2) {
}
}
}
public void update(Graphics paramGraphics) {
paint(paramGraphics);
}
public void paint(Graphics paramGraphics)
{
paramGraphics.drawImage(this.dbImg, 0, 0, this);
}
public void start()
{
if (this.isError) return;
this.isRunning = true;
if (this.runner == null) {
this.runner = new Thread(this);
this.runner.start();
}
}
public void stop()
{
if (this.runner != null) {
this.runner.stop();
this.runner = null;
}
}
public boolean mouseMove(Event paramEvent, int paramInt1, int paramInt2)
{
this.m_mouseX = paramInt1;
this.m_mouseY = paramInt2;
return true;
}
public boolean mouseDown(Event paramEvent, int paramInt1, int paramInt2)
{
this.m_mouseX = paramInt1;
this.m_mouseY = paramInt2;
int i = (int)(this.rand.nextDouble() * 256.0D);
int j = (int)(this.rand.nextDouble() * 256.0D);
int k = (int)(this.rand.nextDouble() * 256.0D);
int l = i16 | j8 | k | 0xFF000000;
int i1 = 0;
for (int i2 = 0; i2this.bits;i2)
if (this.bit_f[i2] == 0) {
this.bit_px[i2] = this.m_mouseX;
this.bit_py[i2] = this.m_mouseY;
double d1 = this.rand.nextDouble() * 6.28D;
double d2 = this.rand.nextDouble();
this.bit_vx[i2] = (Math.sin(d1) * d2);
this.bit_vy[i2] = (Math.cos(d1) * d2);
this.bit_l[i2] = ((int)(this.rand.nextDouble() * 100.0D)100);
this.bit_p[i2] = (int)(this.rand.nextDouble() * 3.0D);
this.bit_c[i2] = l;
this.bit_sx[i2] = this.m_mouseX;
this.bit_sy[i2] = (this.m_nAppY - 5);
this.bit_f[i2] = 2;
i1;
if (i1 == this.bit_max)
break;
}
if (this.bit_sound1) this.sound2.play();
return true;
}
public boolean mouseExit(Event paramEvent, int paramInt1, int paramInt2)
{
this.m_mouseX = paramInt1;
this.m_mouseY = paramInt2;
return true;
}
void rend()
{
int i = 0; int j = 0;
int k = 0;
for (int l = 0; lthis.bits;l) {
switch (this.bit_f[l])
{
case 1:
this.bit_vy[l]= this.rand.nextDouble() / 50.0D;
this.bit_px[l]= this.bit_vx[l];
this.bit_py[l]= this.bit_vy[l];
this.bit_l[l] -= 1;
if ((this.bit_l[l] == 0) || (this.bit_px[l]0.0D) || (this.bit_py[l]0.0D) || (this.bit_px[l]this.m_nAppX) || (this.bit_py[l]this.m_nAppY - 3)) {
this.bit_c[l] = -16777216;
this.bit_f[l] = 0;
}
else if (this.bit_p[l] == 0) {
if ((int)(this.rand.nextDouble() * 2.0D) == 0)
bit_set((int)this.bit_px[l], (int)this.bit_py[l], -1);
}
else {
bit_set((int)this.bit_px[l], (int)this.bit_py[l], this.bit_c[l]);
}
break;
case 2:
this.bit_sy[l] -= 5;
if (this.bit_sy[l] = this.bit_py[l]) {
this.bit_f[l] = 1;
k = 1;
}
if ((int)(this.rand.nextDouble() * 20.0D) == 0) {
i = (int)(this.rand.nextDouble() * 2.0D);
j = (int)(this.rand.nextDouble() * 5.0D);
bit_set(this.bit_sx[l]i, this.bit_sy[l]j, -1);
}
}
}
if ((k != 1) || (this.bit_sound = 0)) return; this.sound1.play();
}
void bit_set(int paramInt1, int paramInt2, int paramInt3)
{
int i = paramInt1paramInt2 * this.m_nAppX;
this.pix0[i] = paramInt3;
}
}
给java烟花源代码下载你弄出来java烟花源代码下载了java烟花源代码下载,加分啊
跪求http://www.lili.cc/welcome/java/yanhua.htm里面的烟花FLASH怎么下载下来这个地址里有烟花FLASH啊?
一般简单点么查看源文件,查找带swf的地址就是了
烟花的java程序// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas NeshkovDate: 2003-1-8 9:49:09
// Home Page :- Check often for new version!
// Decompiler options: packimports(3)
// Source File Name:jhanabi.java
import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.util.Random;
public class jhanabi extends Applet
implements Runnable
{
public jhanabi()
{
m_mouseX = 0;
m_mouseY = 0;
m_sleepTime = 5;
isError = false;
isInitialized = false;
rand = new Random();
bits = 10000;
bit_px = new double[bits];
bit_py = new double[bits];
bit_vx = new double[bits];
bit_vy = new double[bits];
bit_sx = new int[bits];
bit_sy = new int[bits];
bit_l = new int[bits];
bit_f = new int[bits];
bit_p = new int[bits];
bit_c = new int[bits];
ru = 50;
rv = 50;
}
public void init()
{
String s = getParameter("para_bits");
if(s != null)
bits = Integer.parseInt(s);
s = getParameter("para_max");
if(s != null)
bit_max = Integer.parseInt(s);
s = getParameter("para_blendx");
if(s != null)
ru = Integer.parseInt(s);
s = getParameter("para_blendy");
if(s != null)
rv = Integer.parseInt(s);
s = getParameter("para_sound");
if(s != null)
bit_sound = Integer.parseInt(s);
m_nAppX = size().width;
m_nAppY = size().height;
m_centerX = m_nAppX / 2;
m_centerY = m_nAppY / 2;
m_mouseX = m_centerX;
m_mouseY = m_centerY;
resize(m_nAppX, m_nAppY);
pixls = m_nAppX * m_nAppY;
pixls2 = pixls - m_nAppX * 2;
pix0 = new int[pixls];
offImage = new MemoryImageSource(m_nAppX, m_nAppY, pix0, 0, m_nAppX);
offImage.setAnimated(true);
dbImg = createImage(offImage);
for(int i = 0; ipixls; i)
pix0[i] = 0xff000000;
sound1 = getAudioClip(getDocumentBase(), "firework.au");
sound2 = getAudioClip(getDocumentBase(), "syu.au");
for(int j = 0; jbits; j)
bit_f[j] = 0;
isInitialized = true;
start();
}
public void run()
{
while(!isInitialized)
try
{
Thread.sleep(200L);
}
catch(InterruptedException interruptedexception) { }
do
{
for(int j = 0; jpixls2; j)
{
int k = pix0[j];
int l = pix0[j1];
int i1 = pix0[jm_nAppX];
int j1 = pix0[jm_nAppX1];
int i = (k0xff0000)16;
int k1 = ((((l0xff0000)16) - i) * ru8)i;
i = (k0xff00)8;
int l1 = ((((l0xff00)8) - i) * ru8)i;
i = k0xff;
int i2 = (((l0xff) - i) * ru8)i;
i = (i10xff0000)16;
int j2 = ((((j10xff0000)16) - i) * ru8)i;
i = (i10xff00)8;
int k2 = ((((j10xff00)8) - i) * ru8)i;
i = i10xff;
int l2 = (((j10xff) - i) * ru8)i;
int i3 = ((j2 - k1) * rv8)k1;
int j3 = ((k2 - l1) * rv8)l1;
int k3 = ((l2 - i2) * rv8)i2;
pix0[j] = i316 | j38 | k3 | 0xff000000;
}
rend();
offImage.newPixels(0, 0, m_nAppX, m_nAppY);
try
{
Thread.sleep(m_sleepTime);
}
catch(InterruptedException interruptedexception1) { }
} while(true);
}
public void update(Graphics g)
{
paint(g);
}
public void paint(Graphics g)
{
g.drawImage(dbImg, 0, 0, this);
}
public void start()
{
if(isError)
return;
isRunning = true;
if(runner == null)
{
runner = new Thread(this);
runner.start();
}
}
public void stop()
{
if(runner != null)
{
runner.stop();
runner = null;
}
}
public boolean mouseMove(Event event, int i, int j)
{
m_mouseX = i;
m_mouseY = j;
return true;
}
public boolean mouseDown(Event event, int i, int j)
{
m_mouseX = i;
m_mouseY = j;
int k = (int)(rand.nextDouble() * 256D);
int l = (int)(rand.nextDouble() * 256D);
int i1 = (int)(rand.nextDouble() * 256D);
int j1 = k16 | l8 | i1 | 0xff000000;
int k1 = 0;
for(int l1 = 0; l1bits; l1)
{
if(bit_f[l1] != 0)
continue;
bit_px[l1] = m_mouseX;
bit_py[l1] = m_mouseY;
double d = rand.nextDouble() * 6.2800000000000002D;
double d1 = rand.nextDouble();
bit_vx[l1] = Math.sin(d) * d1;
bit_vy[l1] = Math.cos(d) * d1;
bit_l[l1] = (int)(rand.nextDouble() * 100D)100;
bit_p[l1] = (int)(rand.nextDouble() * 3D);
bit_c[l1] = j1;
bit_sx[l1] = m_mouseX;
bit_sy[l1] = m_nAppY - 5;
bit_f[l1] = 2;
if(k1 == bit_max)
break;
}
if(bit_sound1)
sound2.play();
return true;
}
public boolean mouseExit(Event event, int i, int j)
{
m_mouseX = i;
m_mouseY = j;
return true;
}
void rend()
{
boolean flag = false;
boolean flag1 = false;
boolean flag2 = false;
for(int k = 0; kbits; k)
switch(bit_f[k])
{
default:
break;
case 1: // '\001'
bit_vy[k]= rand.nextDouble() / 50D;
bit_px[k]= bit_vx[k];
bit_py[k]= bit_vy[k];
bit_l[k]--;
if(bit_l[k] == 0 || bit_px[k]0.0D || bit_py[k]0.0D || bit_px[k](double)m_nAppX || bit_py[k](double)(m_nAppY - 3))
{
bit_c[k] = 0xff000000;
bit_f[k] = 0;
} else
if(bit_p[k] == 0)
{
if((int)(rand.nextDouble() * 2D) == 0)
bit_set((int)bit_px[k], (int)bit_py[k], -1);
} else
{
bit_set((int)bit_px[k], (int)bit_py[k], bit_c[k]);
}
break;
case 2: // '\002'
bit_sy[k] -= 5;
if((double)bit_sy[k] = bit_py[k])
{
bit_f[k] = 1;
flag2 = true;
}
if((int)(rand.nextDouble() * 20D) == 0)
{
int i = (int)(rand.nextDouble() * 2D);
int j = (int)(rand.nextDouble() * 5D);
bit_set(bit_sx[k]i, bit_sy[k]j, -1);
}
break;
}
if(flag2bit_sound0)
sound1.play();
}
void bit_set(int i, int j, int k)
{
int l = ij * m_nAppX;
pix0[l] = k;
}
private int m_nAppX;
private int m_nAppY;
private int m_centerX;
private int m_centerY;
private int m_mouseX;
private int m_mouseY;
private int m_sleepTime;
private boolean isError;
private boolean m_isPaintFinished;
boolean isRunning;
boolean isInitialized;
Thread runner;
int pix0[];
MemoryImageSource offImage;
Image dbImg;
int pixls;
int pixls2;
Random rand;
int bits;
double bit_px[];
double bit_py[];
double bit_vx[];
double bit_vy[];
int bit_sx[];
int bit_sy[];
int bit_l[];
int bit_f[];
int bit_p[];
int bit_c[];
int bit_max;
int bit_sound;
int ru;
int rv;
AudioClip sound1;
AudioClip sound2;
}
一个电子烟花怎么看到源代码您好,要查看电子烟花的源代码,首先需要找到电子烟花的开发者 , 并且询问他们是否提供源代码 。如果提供了源代码,可以通过下载源代码的方式来获取 。也可以使用GitHub或其他代码托管网站来查看源代码,这些网站提供了一个可以查看源代码的界面,可以让您查看源代码的内容 。此外,您还可以使用特定的编辑器来查看源代码,这样可以更好地理解源代码的意义和功能 。
【java烟花源代码下载 python炫酷烟花源代码】关于java烟花源代码下载和python炫酷烟花源代码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读