亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gamemanager.java

?? J2ME MIDP_Example_Applications
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
            else
            {
                // After 4 seconds, prompt the user to return to main menu.
                lastText = dict.getString(Dictionary.TEXT_GAME_QUIT_PROMPT);
            }

            drawShortMessage(g, color, winnerText,
                (dict.getString(Dictionary.TEXT_GAME_YOU) + ": " + baseScore),
                (dict.getString(Dictionary.TEXT_GAME_BLOCKS) + ": " +
                blocksScore),
                lastText);
        }
        else
        {
            // The game is still in progress.
            drawGame(g);
        }
    }


    private void drawBackground(Graphics g)
    {
        // The canvas may be bigger than the drawable game.
        // We first erase the entire canvas with WHITE,
        // and next draw a BLACK game board.
        if ((gameWidth < canvas.getWidth()) ||
            (gameHeight < canvas.getHeight()))
        {
            g.setColor(0xFFFFFF); // WHITE
            g.fillRect(0, 0, canvas.getWidth(),
                       canvas.getHeight());
        }

        g.setColor(0x000000); // BLACK
        g.fillRect(0, 0, gameWidth, gameHeight);
    }


    private void drawGame(Graphics g)
    {
        // Draw background
        drawBackground(g);

        // Draw bullets
        Bullet b = (Bullet) (bullets.getFirst());

        while (b != null)
        {
            b.draw(g);
            b = (Bullet) bullets.getNext(b);
        }

        // Draw blocks
        g.setColor(Base.COLOR);
        for (int ix = 0; ix < blocks.size(); ix++)
        {
            Block block = (Block) blocks.elementAt(ix);
            block.draw(g);
        }

        // At the bottom of the screen, either draw the blocks' score or
        // draw the resume message after a pause.
        g.setFont(GAME_FONT);
        if (isPaused)
        {
            // draw the 'Push a key to resume' message after a pause
            String str = dict.getString(Dictionary.TEXT_GAME_RESUME_PROMPT);

            g.setColor(Base.COLOR);
            g.drawString(str, gameWidth / 2, (gameHeight - 2),
                         (Graphics.BOTTOM | Graphics.HCENTER));
        }
        else
        {
            // draw the blocks' score
            StringBuffer buf = new StringBuffer(((showLabelTicks > 0) ?
                (dict.getString(Dictionary.TEXT_GAME_BLOCKS) + ": ") : ""));

            buf.append(blocksScore);
            g.setColor(Block.COLOR);
            g.drawString(buf.toString(), (gameWidth - 2), (gameHeight - 2),
                         (Graphics.BOTTOM | Graphics.RIGHT));
        }


        // At the top of the screen:
        //   Draw the 'canon overheating gauge' + base's score and remaining
        //   lives in the upper left corner of the game screen.
        //   (Depending on showLabelTicks, longer or shorter versions
        //   of the strings are drawn.)

        int yOffset = 2; // pixels
        int xOffset = base.getWidth() + base.getCannonDimension() + yOffset;
        int w = 0;

        // draw 'cannon overheating' gauge (to limit fire rate)
        if (useLimitedFiringRate)
        {
            // set gauge's height and width
            int h = GAME_FONT.getHeight();

            w = (2 * h) / 3;

            int coolDownGaugeHeight = (h * base.getCannonCoolDownTicks()) /
                                      Base.MAX_CANNON_COOLDOWN_TICKS;
            int heatGaugeHeight = h * base.getCannonHeat() /
                                  Base.MAX_CANNON_HEAT;
            int xGauge = gameWidth - w - xOffset;

            if (coolDownGaugeHeight > 0)
            {
                int color = 0x00FFFF; // cooling: CYAN

                drawGauge(g, Base.COLOR, color, xGauge, yOffset, w, h,
                          coolDownGaugeHeight);
            }
            else
            {
                int color = Base.COLOR;

                if (heatGaugeHeight > 0)
                {
                    color = 0xFF55FF; // hot: MAGENTA(ish)
                    drawGauge(g, Base.COLOR, color, xGauge, yOffset, w, h,
                              heatGaugeHeight);
                }
            }
        }

        // draw base score/lives text
        g.setColor(Base.COLOR);

        StringBuffer buf = new StringBuffer((showLabelTicks > 0) ?
            (dict.getString(Dictionary.TEXT_GAME_YOU) + ": ") : "");

        buf.append(baseScore);
        buf.append(" (");
        buf.append(base.getLives());
        buf.append((showLabelTicks > 0) ?
            " " + dict.getString(Dictionary.TEXT_GAME_LIVES) : "");
        buf.append(")");

        g.setColor(Base.COLOR);
        g.drawString(buf.toString(), xOffset, yOffset,
            (Graphics.TOP | Graphics.LEFT));

        // Draw base
        base.draw(g);
    }


    private void drawGauge(Graphics g, int outerColor, int fillColor,
        int x, int y, int w, int h, int gh)
    {
        // Draw the gauge so that it looks a bit like the
        // ASCII art below. ('Y' is the base color (yellow) and
        // 'f' is the fill color of the gauge.)
        //      YYYYYYYY
        //    f Y      Y f
        //    f YffffffY f
        //    f YffffffY f
        //      YYYYYYYY

        g.setColor(outerColor);
        g.drawRect((x + 1), y, (w - 2), (h - 1));
        g.setColor(fillColor);
        g.drawLine(x, (y + 2), x, (y + h - 3));
        g.drawLine((x + w), (y + 2), (x + w), (y + h - 3));
        g.fillRect((x + 2), (y + 1 + h - gh), (w - 3), (gh - 2));
    }


    // Erase the entire canvas, and draw a short final message
    // consisting of two lines of text. No attempt is made to fit the
    // text onto the available canvas space, so the caller must
    // use short text strings.

    private void drawShortMessage(Graphics g, int color, String s1, String s2,
                                  String s3, String s4)
    {
        drawBackground(g);

        g.setColor(color);
        g.setFont(GAME_FONT);

        int fh = GAME_FONT.getHeight();
        // yOffset needed to vertically center 4 lines of text
        int yOffset = (gameHeight - (4 * fh)) / 2;
        int xCenter = gameWidth / 2;
        int anchor = (Graphics.TOP | Graphics.HCENTER);

        g.drawString(s1, xCenter, yOffset, anchor);
        g.drawString(s2, xCenter, yOffset + fh, anchor);
        g.drawString(s3, xCenter, yOffset + (2 * fh), anchor);
        if (s4 != null)
        {
            g.drawString(s4, xCenter, yOffset + (3 * fh), anchor);
        }
    }


    void addBullet(Bullet b)
    {
        bullets.addFirst(b);
        gameEffects.playBullet();
    }


    void doBlockPassed(Block block)
    {
        blocksScore += block.getPoints();
    }


    void closePressed()
    {
        // The GameManager handles the 'closePressed' event from one
        // of two possible sources:
        //  - any softkey press in a NokiaCloseableCanvas (FullCanvas)
        //    indicates that 'close' was pressed
        //  - a CloseableCanvas (Canvas) uses its 'Back' command
        //    to indicate that close was pressed
        // The 'closed' canvas is suspended but not destroyed.
        // It can be resumed and shown on the display again later.
        if (!isPaused)
        {
            pause();
        }

        midlet.gameManagerMainMenu(isGameOver);
    }


    public void keyPressed(int keyCode)
    {
        // When we return to an existing game screen from a 'Continue'
        // in the MainMenu, the game remains paused though displayed.
        // This gives the player time to put their fingers back
        // onto the game keys before the game resumes.
        // The first game key press resumes the game.
        if (isPaused && canvas.isShown())
        {
            resume();
        }

        // The base handles game key presses with gameActionPressed;
        // 'true' means 'game action pressed'.
        base.gameActionPressed(canvas.getGameAction(keyCode), true);
    }


    public void keyReleased(int keyCode)
    {
        // The base handles game key releases with gameActionPressed.
        // 'false' means 'game action released' (i.e. no longer pressed).
        base.gameActionPressed(canvas.getGameAction(keyCode), false);
    }


    // Runnable

    public void run()
    {
        Thread currentThread = Thread.currentThread();

        try
        {
            // This ends when animationThread is set to null, or when
            // it is subsequently set to a new thread; either way, the
            // current thread should terminate.
            while (currentThread == animationThread)
            {
                long startTime = System.currentTimeMillis();

                if (!isPaused)
                {
                    if (canvas.isShown())
                    {
                        // We shouldn't use a transition to the 'not shown'
                        // state to pause the game (see below), until we
                        // are first sure that we have been shown at
                        // some time.
                        if (!hasBeenShown)
                        {
                            hasBeenShown = true;
                        }

                        // We only tick if we are shown.
                        tick();
                    }
                    else
                    {
                        // The game canvas is no longer shown. We should
                        // pause the game since it is no longer visible.
                        // An example is when a system pop-up window like a
                        // low battery warning, incoming phone call, etc.
                        // occurs during the game.
                        // (The method keyPress is used to resume after
                        // such a pause.)
                        if (hasBeenShown)
                        {
                            pause();
                        }
                    }
                }

                // After each tick, we request a repaint.
                // We do not request a repaint when we are not shown.
                //
                // (The repaint below also allows the paint method to print
                // the "Press any key to resume" message after a pause
                // caused by the "!isShown()" code just above,
                // when the game canvas becomes shown again (e.g. after
                // the system pop-up window disappears). The method keyPress
                // causes the actual resume.)
                if (canvas.isShown())
                {
                    canvas.repaint(0, 0, gameWidth, gameHeight);
                    canvas.serviceRepaints();
                }


                long timeTaken = System.currentTimeMillis() - startTime;

                if (timeTaken < MILLIS_PER_TICK)
                {
                    synchronized(this)
                    {
                        wait(MILLIS_PER_TICK - timeTaken);
                    }
                }
                else
                {
                    currentThread.yield();
                }
            }
        }
        catch (InterruptedException e)
        {
        }
    }


    public synchronized void start()
    {
        animationThread = new Thread(this);
        animationThread.start();
        gameEffects.resume();
    }


    public synchronized void stop()
    {
        animationThread = null;
        gameEffects.pause();
    }


    public void pause()
    {
        synchronized(this)
        {
            isPaused = true;
        }
        gameEffects.pause();
    }


    public synchronized boolean isPaused()
    {
        return isPaused;
    }


    public void resume()
    {
        synchronized(this)
        {
            isPaused = false;
        }
        gameEffects.resume();
    }


    public Canvas getCanvas()
    {
        return canvas;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久天天| 国产一区二区中文字幕| 色偷偷88欧美精品久久久| 日韩美女视频一区二区| 91成人网在线| 亚洲18色成人| 精品久久一区二区| 国产成人综合亚洲91猫咪| 国产精品久久久一本精品 | 免费高清在线视频一区·| 欧美群妇大交群的观看方式| 男男成人高潮片免费网站| 亚洲精品一区二区三区影院| 国产成人精品网址| 亚洲免费观看高清在线观看| 欧美精品久久久久久久多人混战| 美女网站视频久久| 国产精品国产三级国产aⅴ入口| 91久久精品日日躁夜夜躁欧美| 日韩经典一区二区| 久久精品人人做人人综合 | 国产精品18久久久久久vr| 最好看的中文字幕久久| 欧美日韩国产成人在线91| 狠狠色丁香婷婷综合久久片| 亚洲色图在线视频| 日韩精品一区二区三区视频| 97久久超碰国产精品电影| 婷婷丁香久久五月婷婷| 日本一区二区久久| 69av一区二区三区| 99re视频这里只有精品| 日韩在线一区二区三区| 国产精品久久久久久久久果冻传媒 | 99天天综合性| 久久国产精品99久久久久久老狼 | 久久精品人人做| 欧美久久婷婷综合色| 国产福利一区二区三区视频在线| 亚洲综合在线观看视频| 久久久精品2019中文字幕之3| 欧美三级日韩在线| av在线播放成人| 裸体歌舞表演一区二区| 亚洲精品亚洲人成人网在线播放| 久久天天做天天爱综合色| 欧美日本一区二区在线观看| 成人污视频在线观看| 日本不卡123| 亚洲成人av在线电影| 日韩美女精品在线| 日本一区二区视频在线观看| 欧美成人伊人久久综合网| 欧美日韩色一区| 色屁屁一区二区| 99久久精品情趣| 丁香婷婷综合色啪| 国内成人精品2018免费看| 亚洲国产精品一区二区久久恐怖片| 国产精品久久99| 国产三级一区二区| 久久新电视剧免费观看| 日韩一区二区三区观看| 欧美挠脚心视频网站| 欧美在线观看禁18| 日本黄色一区二区| 91国偷自产一区二区三区观看| www.爱久久.com| 成人精品免费看| 成人免费不卡视频| 成人av小说网| eeuss鲁一区二区三区| 成人久久18免费网站麻豆| 国产宾馆实践打屁股91| 国产乱对白刺激视频不卡| 国产资源精品在线观看| 久久精品99国产国产精| 久久99精品一区二区三区三区| 日韩影院精彩在线| 蜜臀va亚洲va欧美va天堂| 另类小说图片综合网| 蜜桃精品视频在线| 久久99国产精品免费| 国产一区二区三区蝌蚪| 国产高清不卡二三区| 波多野结衣亚洲| 91在线视频在线| 一本色道综合亚洲| 欧美日韩国产小视频| 欧美一区二区福利在线| 久久美女艺术照精彩视频福利播放| 精品国产精品一区二区夜夜嗨| 欧美mv日韩mv国产| 亚洲国产激情av| 一片黄亚洲嫩模| 日韩电影在线观看电影| 国精产品一区一区三区mba桃花| 国产精品 日产精品 欧美精品| av亚洲精华国产精华| 欧美无人高清视频在线观看| 91精品国产手机| 久久精品欧美日韩| 亚洲精品免费一二三区| 免费在线视频一区| 成人动漫视频在线| 精品视频999| 久久久精品2019中文字幕之3| 中文字幕一区二区三区在线不卡| 亚洲bt欧美bt精品| 国产高清成人在线| 欧美日韩一区不卡| 2020国产精品| 亚洲欧美一区二区三区极速播放 | 亚洲电影第三页| 精品一区二区三区影院在线午夜| 成人免费高清在线| 欧美绝品在线观看成人午夜影视| 久久久久久久久蜜桃| 亚洲最大色网站| 国产成人亚洲综合a∨婷婷图片 | 91在线你懂得| 精品理论电影在线| 亚洲午夜久久久久中文字幕久| 狠狠色狠狠色综合| 91福利国产精品| 亚洲国产精品精华液ab| 日本va欧美va精品| 91在线视频在线| 久久嫩草精品久久久精品| 亚洲愉拍自拍另类高清精品| 国产高清亚洲一区| 69堂国产成人免费视频| 亚洲另类色综合网站| 国产一区二区三区在线观看精品 | 欧美一级高清片| 亚洲精品少妇30p| 国产成人免费在线| 91精品国产高清一区二区三区蜜臀| 国产精品第五页| 韩国精品在线观看| 欧美一区二区在线观看| 亚洲综合一区二区三区| 99riav一区二区三区| 国产性做久久久久久| 美女国产一区二区三区| 欧美日韩一区二区三区四区五区| 亚洲天堂2014| 成人午夜私人影院| 国产亚洲欧美色| 国产资源在线一区| 欧美大片一区二区| 奇米精品一区二区三区四区| 欧美日韩一区二区三区高清| 一区二区三区美女视频| 91亚洲精品久久久蜜桃| 欧美高清一级片在线观看| 国产精品伊人色| 精品福利二区三区| 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产日韩v精品一区二区| 麻豆精品在线播放| 精品美女在线播放| 九九视频精品免费| 欧美精品一区二区三区一线天视频| 麻豆精品一区二区综合av| 欧美一二三四在线| 开心九九激情九九欧美日韩精美视频电影| 欧美人xxxx| 另类的小说在线视频另类成人小视频在线 | 成人白浆超碰人人人人| 欧美国产成人在线| 成人国产精品免费网站| 亚洲欧美中日韩| 91成人在线免费观看| 亚洲成人激情综合网| 在线播放中文字幕一区| 美女视频黄a大片欧美| 精品久久久久久久久久久久久久久久久 | 天涯成人国产亚洲精品一区av| 欧美性一二三区| 亚洲成人自拍网| 日韩视频在线永久播放| 国产在线视频精品一区| 国产偷国产偷精品高清尤物| 成人美女在线观看| 亚洲一区在线观看视频| 欧美美女黄视频| 国产在线精品免费| 国产精品电影一区二区三区| 欧美午夜影院一区| 精品制服美女久久| 中文字幕高清一区| 在线免费亚洲电影| 麻豆国产精品官网| 国产精品久久午夜夜伦鲁鲁| 欧美怡红院视频| 国产麻豆精品一区二区| 亚洲乱码国产乱码精品精98午夜| 7799精品视频| 成人黄色av网站在线|