1. <li id="3se62"></li>
      <th id="3se62"></th>

      <progress id="3se62"></progress>
         你好,歡迎來到電腦編程技巧與維護雜志社! 雜志社簡介廣告服務讀者反饋編程社區  
        合訂本訂閱
         
         
        您的位置:雜志經典 / 圖形圖象處理與游戲編程
        Java Applet開發大魚吃小魚游戲(六)
         

        offScreen.drawImage(image1f,fishpos[0][0],fishpos[0][1],this);

                //省略其他小魚顯示代碼

               

            //吃到小魚1,計算得分及生命值

            if(showfish1==1)

            if(mousex+70>=fishpos[0][0]&&mousex+70<=fishpos[0][0]+104&&

               mousey+32>=fishpos[0][1]&&mousey+32<=fishpos[0][1]+57)

            {

              life=life+6;

              if(life>100)

                life=100;

              score=score+6;

              fishpos[0][0]=0;

              fishpos[0][1]=40;

              showfish1=0;

        }

        //省略吃其他小魚代碼

            /*根據大鯊魚的坐標,決定是否顯示小魚*/

            if(mousey>300)

        showfish1=1;

                //省略其他小魚是否顯示代碼

               

            //顯示得分及時間

            offScreen.setFont(new Font("Dialog",Font.PLAIN,28));

            offScreen.setColor(Color.yellow);

            offScreen.drawString("得分:"+score,20,20);

        offScreen.drawString(

        "時間:"+(System.currentTimeMillis()-starttime)/1000,250,20);

            //顯示氣泡

            offScreen.setColor(Color.white);

            offScreen.fillOval(bubblepos[0][0],bubblepos[0][1],30,30);

            offScreen.fillOval(bubblepos[1][0],bubblepos[1][1],30,30);

            offScreen.fillOval(bubblepos[2][0],bubblepos[2][1],30,30);

            /*吃到氣泡,減少生命值,并重新計算氣泡位置*/    if(bubblepos[0][0]+15>=mousex&&bubblepos[0][0]+15<=mousex+139&&

               bubblepos[0][1]+15>=mousey&&bubblepos[0][1]+15<=mousey+64)

            {

              life=life-30;

              bubblepos[0][0]=100;

              bubblepos[0][1]=450;

            }    if(bubblepos[1][0]+15>=mousex&&bubblepos[1][0]+15<=mousex+139&&

               bubblepos[1][1]+15>=mousey&&bubblepos[1][1]+15<=mousey+64)

            {

          推薦精品文章

        ·2023年7月目錄
        ·2023年6月目錄 
        ·2023年5月目錄
        ·2023年4月目錄 
        ·2023年3月目錄 
        ·2023年2月目錄 
        ·2023年1月目錄 
        ·2022年12月目錄 
        ·2022年11月目錄 
        ·2022年10月目錄 
        ·2022年9月目錄 
        ·2022年8月目錄 
        ·2022年7月目錄 
        ·2022年6月目錄 

          聯系方式
        TEL:010-82561037
        Fax: 010-82561614
        QQ: 100164630
        Mail:gaojian@comprg.com.cn

          友情鏈接
         
        Copyright 2001-2010, www.1wcdp.top, All Rights Reserved
        京ICP備14022230號-1,電話/傳真:010-82561037 82561614 ,Mail:gaojian@comprg.com.cn
        地址:北京市海淀區遠大路20號寶藍大廈E座704,郵編:100089 
        1. <li id="3se62"></li>
          <th id="3se62"></th>

          <progress id="3se62"></progress>
            操美女小骚逼