📄 ccb_welcome.java
字号:
int j = pixs[i];
int k = pixs[i + 1];
int l = pixs[i + widthBack];
int i1 = pixs[i + widthBack + 1];
int j1 = (j & 0xff0000) >> 16;
int k1 = ((((k & 0xff0000) >> 16) - j1) * ru >> 8) + j1;
j1 = (j & 0xff00) >> 8;
int l1 = ((((k & 0xff00) >> 8) - j1) * ru >> 8) + j1;
j1 = j & 0xff;
int i2 = (((k & 0xff) - j1) * ru >> 8) + j1;
j1 = (l & 0xff0000) >> 16;
int j2 = ((((i1 & 0xff0000) >> 16) - j1) * ru >> 8) + j1;
j1 = (l & 0xff00) >> 8;
int k2 = ((((i1 & 0xff00) >> 8) - j1) * ru >> 8) + j1;
j1 = l & 0xff;
int l2 = (((i1 & 0xff) - j1) * ru >> 8) + j1;
int i3 = ((j2 - k1) * rv >> 8) + k1;
int j3 = ((k2 - l1) * rv >> 8) + l1;
int k3 = ((l2 - i2) * rv >> 8) + i2;
pixs[i] = i3 << 16 | j3 << 8 | k3 | 0xFF000000;
}
rend();
offImage.newPixels(0, 0, widthBack, heightBack);
try{
Thread.sleep(5l);
}catch(InterruptedException iEx){}
//MAKE WAVE
if(currFrames < numFrames) currFrames ++;else currFrames =0;
Graphics gBuffer = imageBuffer.getGraphics();
gBuffer.drawImage(imageSky, 0, 0, this);
gBuffer.drawImage(imageBack, 0, 92, this);
referFront(gBuffer);
wave(gBuffer, currFrames);
try{
thread1.sleep(40l);
}catch(InterruptedException iEx){}
repaint();
}
}
void rend()
{
boolean flag = false;
boolean flag1 = false;
boolean flag2 = false;
bit_time ++;
for(int i = 0; i < bits; i++)
switch(bit_f[i])
{
default:
break;
case 1:
bit_vy[i] += rand.nextDouble() / 30D;
if(bit_t[i] != 0 || (bit_time < bit_time_l ||bit_time > bit_time_l+10)){
bit_px[i] += bit_vx[i];
bit_py[i] += bit_vy[i];
}else if(bit_t[i] == 0){
int vx = (int)bit_px[i]-(widthBack/2-34);
int vy = (int)bit_py[i]-(heightBack/2-34);
if(vx >=0 && vx <68 && vy >=0 && vy <68){
int a = pixsCCB[vy*imageCCB.getWidth(null)+vx]&0x00FFFFFF;
}
if(bit_time < bit_time_l+5)
imageBuffer.getGraphics().drawImage(imageCCB, widthBack/2-45, heightBack/2-50, this);
}
bit_l[i]--;
if(bit_l[i] <= 0 || bit_px[i] < 0.0D || bit_py[i] < 0.0D || bit_px[i] > (double)widthBack || bit_py[i] > (double)(heightBack - 3))
{
bit_c[i] = 0xff000000;
bit_f[i] = 0;
} else
if(bit_p[i] == 0)
{
if((int)(rand.nextDouble() * 2D) == 0)
bit_set((int)bit_px[i], (int)bit_py[i], -1);
} else
{
bit_set((int)bit_px[i], (int)bit_py[i], bit_c[i]);
}
break;
case 2:
bit_sy[i] -= 10;
if((double)bit_sy[i] <= bit_py[i])
{
bit_f[i] = 1;
flag2 = true;
}
if((int)(rand.nextDouble() * 40D) == 0)
{
int j = (int)(rand.nextDouble() * 2D);
int k = (int)(rand.nextDouble() * 5D);
bit_set(bit_sx[i] + j, bit_sy[i] + k, -1);
}
break;
}
if(flag2)
sound1.play();
}
public void wave(Graphics g, int i){
int heightImage, widthImage;
heightImage = imageBack.getHeight(null);
widthImage = imageBack.getWidth(null);
double d = (6.2831853071795862D * (double)i) / (double)numFrames;
for(int j = 0; j < heightImage; j++)
{
int k = (int)(((double)(heightImage / 14) * ((double)j + 28D) * Math.sin((double)((heightImage / 14) * (heightImage - j)) / (double)(j + 1)+d)) / (double)heightImage);
if(j - heightImage > k)
g.copyArea(0, heightImage - j, widthImage, 1, 10, j << 1);
else
g.copyArea(0,
(heightImage - j) + k,
widthImage,
1,
0,
(j << 1)-k);
}
}
void bit_set(int x, int y, int k){
try{
int l = x + y * widthBack;
pixs[l] = k;
}catch(Exception ex){System.out.println("l="+k);}
}
public boolean mouseDown(Event event, int i, int j){
createFire(i, j, 1);
return true;
}
public boolean createFire(int i, int j, int t){
int m_mouseX = i;
int m_mouseY = j;
int k = (int)(rand.nextDouble() * 256D);
int l = (int)(rand.nextDouble() * 256D);
int i1 = (int)(rand.nextDouble() * 256D);
int j1 = k << 16 | l << 8 | i1 | 0xff000000;
int k1 = 0;
if(t == 0){
bit_time =0;
j1 = 0xFF0000FF;
}
for(int l1 = 0; l1 < bits; l1++)
{
if(bit_f[l1] != 0)
continue;
bit_px[l1] = m_mouseX;
bit_py[l1] = m_mouseY +5;
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() * 80D) ;
bit_p[l1] = (int)(rand.nextDouble() * 5D);
bit_c[l1] = j1;
bit_sx[l1] = m_mouseX;
bit_sy[l1] = heightBack - 5;
bit_f[l1] = 2;
bit_t[l1] = t;
if(++k1 == bit_max)
break;
}
sound2.play();
return true;
}
void referFront(Graphics g){
int y =0, h =0;
System.out.println("fullFront:"+fullFront+",strTextIdx:"+strTextIdx);
if (isFull ==true) {
if(fullFront >=255){
isFull = false;
}else fullFront+= fullPace;
}else {
if(fullFront <= 5){
isFull = true;
if(strTextIdx < strText.length-1) strTextIdx ++; else strTextIdx=0;
}else fullFront -=fullPace;
}
//int j=widthFront*strTextIdx*50;
for(int i=0; i <heightFront*strText.length*widthFront; i++){
if((pixsFront[i] & 0xFF) > 5){
pixsFront[i]=(fullFront<<24) |
(pixsFront[i] & 0x00FFFFFF);
}
}
offFront.newPixels();
if(cFront < 3) cFront ++;
else{
cFront =0;
//offFront.newPixels();
}
y = strTextIdx *50;
h = y + 50;
g.drawImage(imageFront,
xFront-(fullFront>>3), yFront,//-(fullFront>>5),
xFront+widthFront+(fullFront>>3), yFront+50+(fullFront>>5),
0, y,
250, h,
this);
}
private class makeFire implements Runnable{
Random rand;
Thread thread1;
makeFire(){
rand = new Random();
thread1 = new Thread(this);
thread1.start();
}
public void run(){
while(isEnd == false){
try{
thread1.sleep(rand.nextInt(10)*600);
}catch(InterruptedException iEx){}
if(rand.nextInt(2)==0 && bit_time > bit_time_l+130){
bit_max = 500;
createFire(widthBack /2 -10 , heightBack /2-30, 0);
}else{
bit_max = 120;
createFire(rand.nextInt(450)+20, rand.nextInt(50)+20, 1);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -