PAOPAO

//泡泡

import javax.microedition.lcdui.*;

      class Paopao extends Sprite {
int weili=3;//爆炸范围

     
         Paopao(Image paopao){
            super(paopao,24,24);
            setTransform(2);
         
       
    setFrameSequence(new int[]{5,6,5,6,5,6,7,8,9});
  }
public void paint(Graphics g,int x,int y){
      this.x=x;this.y=y;
        if(visible){
                            
            Trans(g,x-sequence[count%sequence.length]%n*width,y-(sequence[count%sequence.length]/n)*height,transform);
            if(count>=6) p_paozha(g,x-sequence[count%sequence.length]%n*width,y-(sequence[count%sequence.length]/n)*height);           
            count++;
            if(count==9) setVisible(false);
               }  }
public void p_paozha(Graphics g,int a,int b){
   
    for(int i=1;i<=weili;i++){
    g.setClip(x,y+i*height,width,height);
    g.drawImage(sprite,a,b+i*height,0);}
   
    for(int i=1;i<=weili;i++){
    g.setClip(x,y-i*height,width,height);
    g.drawImage(sprite,a,b-i*height,0);}
   
    for(int i=1;i<=weili;i++){
    g.setClip(x+i*width,y,width,height);
    g.drawImage(sprite,a+i*width,b,0);}
   
    for(int i=1;i<=weili;i++){
    g.setClip(x-i*width,y,width,height);
    g.drawImage(sprite,a-i*width,b,0);} 
                                          }
 } 

你可能感兴趣的:(PAOPAO)