当前位置: 首页 > 工具软件 > PaoPao CE > 使用案例 >

PAOPAO

芮念
2023-12-01

//泡泡

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);} 
                                          }
 } 

 类似资料:

相关阅读

相关文章

相关问答