91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 24KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-13
  • 語言: Java
  • 標簽: 煙花??

資源簡介

JAVA實現的煙花效果源碼

資源截圖

代碼片段和文件信息

package?com.ice.flame;

import?java.awt.Color;
import?java.awt.Graphics;
import?java.util.Random;

public?class?Firework?{
private?int?widthheightG;???????????????//環境屬性
private?int?Xx?XyEx[]?Ey[]x?y;???????//物理屬性
private?int?energy?patch;????????????????//威力屬性
private?int?tlength;?????????????????????//進度屬性
private?int?Red?Blue?Green;?????????????//色彩屬性






private?Random?random;
private?PlaySounds?ps=new?PlaySounds(“boom.wav“);
public?Firework(int?a?int?b?int?g)?{//?類BeaClassDemo的構造方法
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];//?初始化int數組Ex,其長度為patch
Ey?=?new?int[patch];//?初始化int數組Ey,其長度為patch

//?隨機生成不透明的?sRGB?顏色值
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;?i? Ex[i]?=?(int)?(Math.random()?*?energy)?-?energy?/?2;
Ey[i]?=?(int)?(Math.random()?*?energy?*?7?/?8)?-?energy?/?8;
}
}

public?void?start()?{
t?=?0;
}

public?void?show(Graphics?g)?{//?輸出煙花
if?(t? int?ic;
double?s;

????Color?color;
c?=?(int)?(random.nextDouble()?*?64)?-?32?+?Red;
if?(c?>=?0?&&?c? Red?=?c;
c?=?(int)?(random.nextDouble()?*?64)?-?32?+?Blue;
if?(c?>=?0?&&?c? Blue?=?c;
c?=?(int)?(random.nextDouble()?*?64)?-?32?+?Green;
if?(c?>=?0?&&?c? Green?=?c;
color?=?new?Color(RedGreenBlue);

if(t==0)
{
System.out.println(“boom“);
new?Thread(ps).start();
}
for?(i?=?0;?i? s?=?(double)?t?/?100;
x?=?(int)?(Ex[i]?*?s);
y?=?(int)?(Ey[i]?*?s?-?G?*?s?*?s);
g.setColor(color);
g.drawLine(Xx?+?x?Xy?-?y?Xx?+x?Xy?-?y);

if?(t?>=?length?/?2)?{
int?j;
for?(j?=?0;?j? s?=?(double)?((t-length/2)?*2??+?j)?/?100;
x?=?(int)?(Ex[i]?*?s);
y?=?(int)?(Ey[i]?*?s?-?G?*?s?*?s);
g.setColor(Color.black);
g.drawLine(Xx?+?x?Xy?-?y?Xx?+?x?Xy?-?y);
}
}
}
t++;
}
}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????301??2017-08-10?20:52??Fireworks\.classpath

?????文件????????385??2017-08-10?20:52??Fireworks\.project

?????文件????????598??2017-08-10?20:52??Fireworks\.settings\org.eclipse.jdt.core.prefs

?????文件???????2875??2017-08-10?23:15??Fireworks\bin\com\ice\flame\Firework.class

?????文件????????631??2017-08-10?21:58??Fireworks\bin\com\ice\flame\Fireworks$1.class

?????文件????????868??2017-08-10?21:58??Fireworks\bin\com\ice\flame\Fireworks.class

?????文件???????2378??2017-08-10?21:58??Fireworks\bin\com\ice\flame\MyPanel.class

?????文件???????2632??2017-08-10?21:23??Fireworks\bin\com\ice\flame\PlaySounds.class

?????文件??????20044??2016-04-03?15:10??Fireworks\boom.wav

?????文件???????2511??2017-08-10?23:15??Fireworks\src\com\ice\flame\Firework.java

?????文件???????3104??2017-08-10?21:58??Fireworks\src\com\ice\flame\Fireworks.java

?????文件???????1458??2017-08-10?20:52??Fireworks\src\com\ice\flame\PlaySounds.java

?????目錄??????????0??2017-08-10?21:27??Fireworks\bin\com\ice\flame

?????目錄??????????0??2017-08-10?20:52??Fireworks\src\com\ice\flame

?????目錄??????????0??2017-08-10?21:23??Fireworks\bin\com\ice

?????目錄??????????0??2017-08-10?20:52??Fireworks\src\com\ice

?????目錄??????????0??2017-08-10?21:23??Fireworks\bin\com

?????目錄??????????0??2017-08-10?20:52??Fireworks\src\com

?????目錄??????????0??2017-08-10?20:52??Fireworks\.settings

?????目錄??????????0??2017-08-10?21:23??Fireworks\bin

?????目錄??????????0??2017-08-10?20:52??Fireworks\src

?????目錄??????????0??2017-08-10?20:53??Fireworks

-----------?---------??----------?-----??----

????????????????37785????????????????????22


評論

共有 條評論