资源简介
Java烟花特效(含源码)
本程序来源于互联网
只是修改了下文件名和程序的显示界面
代码片段和文件信息
import java.applet.applet;
import java.applet.AudioClip;
import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.util.Random;
@SuppressWarnings(“serial“)
public class Fireworks extends applet implements Runnable {
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;
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;
public Fireworks() {
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;
}
@SuppressWarnings(“deprecation“)
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; i < pixls; i++)
pix0[i] = 0xff000000;
sound1 = getAudioClip(getDocumentbase() “res/sound1.au“);
sound2 = getAudioClip(getDocumentbase() “res/sound2.au“);
for (int j = 0; j < bits; 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; j < pixls2; j++) {
int k = pix0[j];
int l = pix0[j + 1];
int i1 = pix0[j + m_nAppX];
int j1 = pix0[j + m_nAppX + 1];
int i = (k & 0xff0000) >> 16;
int k1 = ((((l & 0xff0000) >> 16) - i) * ru >> 8) + i;
i = (k & 0xff00) >> 8;
int l1 = ((((l & 0
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-09-04 00:29 Java烟花特效(含源码)\
文件 6528 2012-09-04 00:06 Java烟花特效(含源码)\Fireworks.class
文件 6430 2012-09-04 00:06 Java烟花特效(含源码)\Fireworks.java
文件 1030 2012-09-04 00:28 Java烟花特效(含源码)\index.html
目录 0 2012-09-04 00:08 Java烟花特效(含源码)\res\
文件 35836 2012-09-03 23:49 Java烟花特效(含源码)\res\bgimage.jpg
文件 5978 2012-09-03 22:37 Java烟花特效(含源码)\res\bgmusic.mid
文件 5772 2012-09-03 22:37 Java烟花特效(含源码)\res\sound1.au
文件 437 2012-09-03 22:37 Java烟花特效(含源码)\res\sound2.au
文件 16 2012-09-04 00:30 Java烟花特效(含源码)\说明.txt
- 上一篇:Java 中国象棋
- 下一篇:进程调度java编写含界面
相关资源
- 进程调度java编写含界面
- Java 中国象棋
- java 通过UDP实现一对多聊天室
- js上传zip文件java解压.txt
- java 课程设计 JPEG图片操作
-
java ba
se64的jar包 - java+jsp+oracle实现基本的用户管理系统
- java swing 企业人事管理系统(含数库)
- java+sql学生成绩管理系统有文档.rar
- Java+SQL2000学籍信息管理子系统课程设
- javafx删除table行的demo
- java串口通讯源码
- javaMail 用三种方式实现发送附件
- Google 推出的 Java 编码规范
- java 实现支付宝接口
- java,Eclipse,ATM自动柜台模拟系统
- DFA NFA java实现
- java农夫过河问题
- 图书进存销系统java完整代码
- GN算法Java版源码,个人鼎作
- java课程设计 客房管理系统
- c调用java的
- JAVA爬虫项目源代码
- java 聊天室 计算机网络
- JAVA算术编码
- 小叮当代码JAVA.rar
- java多线程文件传输基于swing
- SpringBoot实现Socket.io消息推送(java+h
- 图书馆管理系统java+S2SH+MySQL
- 数据库课程设计教务管理系统
评论
共有 条评论