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

資源簡介

java入學編程,星際遨游,可加速減速, 超炫的效果

資源截圖

代碼片段和文件信息

import?java.awt.*;
class?Star{
int?HV;
int?xyz;
int?type;
Star(int?widthint?heightint?depthint?type)
{
this.type=type;
H=width/2;
V=height/2;
x=(int)(Math.random()*width)-H;
y=(int)(Math.random()*height)-V;
if((x==0)&&(y==0))?x=10;
z=(int)(Math.random()*depth);

}

public?void?Draw(Graphics?gdouble?rot)
{
double?XY;
int?hvhhvv;
int?d;
z-=2;
if(z<-63)?z=100;
hh=(x*64)/(64+z);
vv=(y*64)/(64+z);
X=(hh*Math.cos(rot))-(vv*Math.sin(rot));
Y=(hh*Math.sin(rot))+(vv*Math.cos(rot));
h=(int)X+H;
v=(int)Y+V;
if((h<0)||(h>(2*H)))?z=100;
if((v<0)||(v>(2*H)))?z=100;
GrayMe(g);
if(type==0)
{
d=(100-z)/50;
if(d==0)??d=1;
g.fillRect(hvdd);
}
else{
d=(100-z)/20;
g.drawLine(h-dvh+dv);
g.drawLine(hv-dhv+d);
if(z<50){
d/=2;
??g.drawLine(h-dv-dh+dv+d);
g.drawLine(h+dv-dh-dv+d);
}
}
}


public?void?GrayMe(Graphics?g){
if(z>50){
g.setColor(Color.darkGray);}
else?if(z>25)
{
g.setColor(Color.lightGray);
}
else
{
g.setColor(Color.white);
}
}
}



public??class?StarFile?extends?java.applet.applet?implements?Runnable
{
int?WidthHeight;
Thread?me?=null;
boolean?suspend=false;
Image?im;
Graphics?offscreen;
double?rotdxddx;

int?speedstarstype;
double?defddxmax;
Star?pol[];

public?void?init(){
rot=0;
dx=0;
ddx=0;
Width=size().width;
Height=size().height;

String?theSpeed=getParameter(“speed“);
Show?(“speed“?theSpeed);
speed?=?(theSpeed?==null)???50?:?Integer.valueOf(theSpeed).intValue();
String?theStars=getParameter(“stars“);
Show(“stars“theStars);
stars?=?(theStars==null)???30:Integer.valueOf(theStars).intValue();

String?theType=getParameter(“type“);
Show(“type“theType);
type=(theType==null)???0:Integer.valueOf(theType).intValue();


String?theRot=getParameter(“spin“);
Show(“spin“theRot);
rot=(theRot==null)???0:Double.valueOf(theRot).doubleValue();

String?theMax=getParameter(“maxspin“);
Show(“maxspin“theRot);
max=(theMax==null)??.1:Double.valueOf(theMax).doubleValue();

String?theddx=getParameter(“ddx“);
Show(“ddx“theddx);
defddx=(theddx==null)???.005:Double.valueOf(theddx).doubleValue();

try
{
im=createImage(WidthHeight);
offscreen=im.getGraphics();
}
catch(Exception?e)
{
offscreen=null;
}
pol=new?Star[stars];
for(int?i=0;ipol[i]=new?Star(WidthHeight100type);
}


public?void?paint?(Graphics?g)
{
if(offscreen?!=null)
{
paintMe(offscreen);
g.drawImage(im00this);
}
else
{
paintMe(g);
}
}


public?void?paintMe(Graphics?g)
{
g.setColor(Color.black);
g.fillRect(00WidthHeight);
//g.setColor(Color.gray);
for(int?i=0;ipol[i].Draw(grot);
}


public?void?start()
{
if(me==null)
{
me=new?Thread(this);
me.start();
}
}

public?void?stop()
{
if(me!=null)
{
me.stop();
me=null;
}
}


public?void?run()
{
while(me!=null)
{
rot+=dx;
dx+=ddx;
if(dx>max)?ddx=-defddx;
if(dx<-max)?ddx=defddx;
try{Thread.sleep(speed);}
catch?(InterruptedException?e){}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-06-17?12:46??燦爛星空\
?????文件?????????119??2012-04-08?21:39??燦爛星空\StarFile.html
?????文件????????3579??2012-04-08?21:33??燦爛星空\StarFile.java

評論

共有 條評論