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

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

?? pushpuzzlecanvas.java

?? 名稱:games
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
        Graphics g = themeImage.getGraphics();        g.setColor(GroundColor0);        g.fillRect((TILE_GROUND - 1) * cell, 0, cell * TILE_PUSHER, cell);        g.setColor(PacketColor0);        g.fillRect(((TILE_PACKET - 1) * cell) + 1, 1, cell - 2, cell - 2);        g.setColor(StoreColor0);        g.drawRect(((TILE_STORE - 1) * cell) + 1, 1, cell - 2, cell - 2);        g.setColor(WallColor0);        g.fillRect((TILE_WALL - 1) * cell, 0, cell, cell);        g.setColor(PusherColor0);        g.fillArc((TILE_PUSHER - 1) * cell, 0, cell, cell, 0, 360);    }    /**     * Setup the theme by reading the images and setting up     * the sprite and picking the tile size.     * Uses the current theme index.     * If the image with the current index can't be found     * retry with theme = 0.     * @param image containing all the frames used for the board.     */    private void setupTheme() {        if (sprite != null) {            layers.remove(sprite);            sprite = null;        }        if (theme > 0) {            try {                StringBuffer name = new StringBuffer("/example/pushpuzzle/images/Theme-");                name.append(theme);                name.append(".png");                themeImage = Image.createImage(name.toString());                // Cells are square using the minimum of the width and height                int h = themeImage.getHeight();                int w = themeImage.getWidth();                cell = (w < h) ? w : h;            } catch (IOException e) {                theme = 0;                setupTheme0();            }        } else {            setupTheme0();        }        sprite = new Sprite(themeImage, cell, cell);        sprite.defineReferencePixel(cell / 2, cell / 2);        int[] seq = new int[] { TILE_PUSHER - 1 };        sprite.setFrameSequence(seq);        layers.insert(sprite, 0);    }    /**     * Return the Screen to display scores.     * It returns a screen with the current scores.     * @return a screen initialized with the current score information.     */    public Screen getScoreScreen() {        Form scoreForm = null; // Temp until form can do setItem        int currPushes = board.getPushes();        int bestPushes = score.getPushes();        int currMoves = board.getMoves();        int bestMoves = score.getMoves();        boolean newbest = solved && ((bestPushes == 0) || (currPushes < bestPushes));        scoreForm = new Form(null);        scoreForm.append(new StringItem(newbest ? "New Best:\n" : "Current:\n",                currPushes + " pushes\n" + currMoves + " moves"));        scoreForm.append(new StringItem(newbest ? "Old Best:\n" : "Best:\n",                bestPushes + " pushes\n" + bestMoves + " moves"));        String title = "Scores";        if (newbest) {            title = "Congratulations";        }        scoreForm.setTitle(title);        return scoreForm;    }    /**     * Handle a repeated arrow keys as though it were another press.     * @param keyCode the key pressed.     */    protected void keyRepeated(int keyCode) {        /*         * After MIDP 2.0 clarification was implemented, keyRepeated()         * method is normally called by system immediately after keyPressed()         * method is called thus the keyRepeated() should not call keyPressed()         * here for now.         *        int action = getGameAction(keyCode);        switch (action) {        case Canvas.LEFT:        case Canvas.RIGHT:        case Canvas.UP:        case Canvas.DOWN:            keyPressed(keyCode);            break;        default:            break;        }         */    }    /**     * Handle a single key event.     * The LEFT, RIGHT, UP, and DOWN keys are used to     * move the pusher within the Board.     * Other keys are ignored and have no effect.     * Repaint the screen on every action key.     */    protected void keyPressed(int keyCode) {        boolean newlySolved = false;        // Protect the data from changing during painting.        synchronized (board) {            cancelTo();            int action = getGameAction(keyCode);            int move = 0;            switch (action) {            case Canvas.LEFT:                move = Board.LEFT;                break;            case Canvas.RIGHT:                move = Board.RIGHT;                break;            case Canvas.DOWN:                move = Board.DOWN;                break;            case Canvas.UP:                move = Board.UP;                break;            // case 0: // Ignore keycode that don't map to actions.            default:                return;            }            // Tell the board to move the piece            int stored = board.getStored();            int dir = board.move(move);            if (stored < board.getStored()) {                // Play a note if a packet hit the spot.                play(storedTune);            }            int pos = board.getPusherLocation();            updateTilesNear(pos, dir);            updateSprite(dir);        } // End of synchronization on the Board.    }    /**     * Update the scores for the current level if it has     * been solved and the scores are better than before.     */    private void updateScores() {        if (!solved) {            return;        }        int sp = score.getPushes();        int bp = board.getPushes();        int bm = board.getMoves();        /*         * Update the scores.  If the score for this level is lower         * than the last recorded score save the lower scores.         */        if ((sp == 0) || (bp < sp)) {            score.setLevelScore(bp, bm);        }    }    /**     * Cancel the animation.     */    private void cancelTo() {        targetx = -1;        targety = -1;    }    /**     * Called when the pointer is pressed.     * Record the target for the pusher.     * @param x location in the Canvas     * @param y location in the Canvas     */    protected void pointerPressed(int x, int y) {        targetx = (x - tiles.getX()) / cell;        targety = (y - tiles.getY()) / cell;    }    /**     * Add a listener to notify when the level is solved.     * The listener is send a List.SELECT_COMMAND when the     * level is solved.     * @param l the object implementing interface CommandListener     */    public void setCommandListener(CommandListener l) {        super.setCommandListener(l);        listener = l;    }    /**     * Update the Sprite location from the board supplied position     * @param dir the sprite is moving     */    private void updateSprite(int dir) {        int loc = board.getPusherLocation();        int x = (loc & 0x7fff) * cell;        int y = ((loc >> 16) & 0x7fff) * cell;        // Update sprite location        sprite.setPosition(tiles.getX() + x, tiles.getY() + y);        dir = Board.RIGHT; // BUG:  Graphics.drawRegion doesn't do xofrm        switch (dir & 0x03) {        case Board.LEFT:            sprite.setTransform(Sprite.TRANS_ROT180);            break;        case Board.UP:            sprite.setTransform(Sprite.TRANS_ROT90);            break;        case Board.DOWN:            sprite.setTransform(Sprite.TRANS_ROT270);            break;        default:            sprite.setTransform(Sprite.TRANS_NONE);            break;        }    }    /**     * Queue a repaint for an area around the specified location.     * @param loc an encoded location from Board.getPusherLocation     * @param dir that the pusher moved and flag if it pushed a packet     */    void updateTilesNear(int loc, int dir) {        int x = loc & 0x7fff;        int y = (loc >> 16) & 0x7fff;        // Update cells if any were moved        if ((dir >= 0) && ((dir & Board.MOVEPACKET) != 0)) {            updateTile(x, y);            updateTile(x + 1, y);            updateTile(x - 1, y);            updateTile(x, y + 1);            updateTile(x, y - 1);        }    }    /**     * Paint the contents of the Canvas.     * The clip rectangle of the canvas is retrieved and used     * to determine which cells of the board should be repainted.     * @param g Graphics context to paint to.     */    public void paint(Graphics g) {        flushGraphics();    }    /**     * The canvas is being displayed.     * Stop the event handling and animation thread.     */    protected void showNotify() {        thread = new Thread(this);        thread.start();    }    /**     * The canvas is being removed from the screen.     * Stop the event handling and animation thread.     */    protected void hideNotify() {        thread = null;    }    /**     * The main event processor. Events are polled and     * actions taken based on the directional events.     */    public void run() {        Graphics g = getGraphics(); // Of the buffered screen image        Thread mythread = Thread.currentThread();        // Loop handling events        while (mythread == thread) {            try { // Start of exception handler                boolean newlySolved = false;                if (!solved && board.solved()) {                    newlySolved = solved = true;                    play(solvedTune);                }                if (newlySolved && (listener != null)) {                    listener.commandAction(List.SELECT_COMMAND, this);                }                if ((targetx >= 0) && (targety >= 0)) {                    int dir = board.runTo(targetx, targety, 1);                    int pos = board.getPusherLocation();                    if (dir < 0) {                        targetx = targety = -1; // Cancel target                    } else {                        updateTilesNear(pos, dir);                        updateSprite(dir);                    }                }                // Check that the pusher is not to close to the edge                int loc = board.getPusherLocation();                int x = (loc & 0x7fff) * cell;                int y = ((loc >> 16) & 0x7fff) * cell;                int lx = tiles.getX();                int ly = tiles.getY();                int panScale = cell / 4;                if (panScale < 1) {                    panScale = 1;                }                // If the sprite is too near the edge (or off) pan                if ((lx + x) > (width - cell - cell)) {                    tiles.move(-panScale, 0);                    sprite.move(-panScale, 0);                }                if ((lx + x) < cell) {                    tiles.move(panScale, 0);                    sprite.move(panScale, 0);                }                if ((ly + y) > (height - cell - cell)) {                    tiles.move(0, -panScale);                    sprite.move(0, -panScale);                }                if ((ly + y) < cell) {                    tiles.move(0, panScale);                    sprite.move(0, panScale);                }                // Draw all the layers and flush                layers.paint(g, 0, 0);                if (mythread == thread) {                    flushGraphics();                }                // g.drawString("PushPuzzle Level " + level, 0, height,                //			     Graphics.BOTTOM|Graphics.LEFT);                try {                    mythread.sleep(PanRate);                } catch (java.lang.InterruptedException e) {                    // Ignore                }            } catch (Exception e) {                e.printStackTrace();            }        }    }    /**     * Play the simple tune supplied.     */    void play(byte[] tune) {        try {            if (tonePlayer == null) {                // First time open the tonePlayer                tonePlayer = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);                tonePlayer.realize();                toneControl = (ToneControl)tonePlayer.getControl(                        "javax.microedition.media.control.ToneControl");            }            tonePlayer.deallocate();            toneControl.setSequence(tune);            tonePlayer.start();        } catch (Exception ex) {            System.out.println(ex.getMessage());        }    }    /*     * Close the tune player and release resources.     */    void closePlayer() {        if (tonePlayer != null) {            toneControl = null;            tonePlayer.close();            tonePlayer = null;        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品嫩草99a| 欧美成人vr18sexvr| 国产视频一区不卡| 国产盗摄视频一区二区三区| 国产亚洲欧洲一区高清在线观看| 精品亚洲porn| 337p日本欧洲亚洲大胆精品| 国产精品99久久久久| 国产精品白丝在线| 91久久奴性调教| 蜜桃精品视频在线观看| 久久综合网色—综合色88| 丰满少妇久久久久久久| 亚洲人吸女人奶水| 欧美日产国产精品| 国模无码大尺度一区二区三区| 国产精品萝li| 在线观看视频91| 麻豆国产精品视频| 国产精品久久久久影院| 在线观看91视频| 久久国产尿小便嘘嘘尿| 国产人妖乱国产精品人妖| 在线免费观看日本欧美| 老司机午夜精品99久久| 中文字幕成人在线观看| 欧美日韩久久不卡| 国产mv日韩mv欧美| 天堂成人国产精品一区| 久久久国际精品| 欧美影视一区在线| 韩国一区二区三区| 亚洲伊人色欲综合网| 26uuu国产电影一区二区| 色综合咪咪久久| 久久99精品国产.久久久久久| 1区2区3区欧美| 欧美大片在线观看| 欧美中文字幕一区二区三区亚洲| 九色porny丨国产精品| 亚洲精品成人在线| 国产日韩欧美不卡在线| 欧美理论电影在线| 99久精品国产| 国产一区二区在线观看免费 | 亚洲电影中文字幕在线观看| 欧美精品一区二区三区视频| 欧美亚洲综合另类| 成人av在线网| 国产一区久久久| 日本怡春院一区二区| 亚洲色图19p| 国产欧美精品一区aⅴ影院| 欧美日韩日日摸| 99re亚洲国产精品| 韩国av一区二区| 日韩**一区毛片| 一区二区三区在线影院| 国产亚洲福利社区一区| 日韩免费观看高清完整版| 欧美色国产精品| 99国产精品一区| a级高清视频欧美日韩| 国产成人午夜99999| 激情久久久久久久久久久久久久久久 | 激情另类小说区图片区视频区| 午夜精品久久久久久久久久| 亚洲视频一区二区在线| 国产精品国产三级国产aⅴ原创| 国产亚洲精品福利| 久久先锋影音av鲁色资源| 日韩视频一区二区| 欧美精品三级日韩久久| 91精品国产综合久久香蕉的特点 | 亚洲风情在线资源站| 亚洲嫩草精品久久| 亚洲美女一区二区三区| 国产精品福利影院| 国产精品久99| 日韩一区在线播放| 洋洋av久久久久久久一区| 亚洲精品国产高清久久伦理二区| 亚洲精品videosex极品| 亚洲美女一区二区三区| 亚洲制服丝袜av| 午夜免费欧美电影| 免费在线观看视频一区| 免费观看在线综合色| 狠狠色狠狠色合久久伊人| 国产美女一区二区三区| 国产精品99久久久久久久女警| 成人丝袜高跟foot| 91色porny在线视频| 精品1区2区3区| 日韩欧美亚洲国产另类| 久久久久99精品一区| 国产精品久久久久久久久图文区 | 91精品国产乱码| 欧美大度的电影原声| 国产日韩欧美高清在线| 亚洲人123区| 丝袜美腿亚洲一区| 韩国三级在线一区| 波多野结衣中文字幕一区| 欧洲一区在线观看| 日韩一区二区麻豆国产| 国产女人水真多18毛片18精品视频| 亚洲欧洲av色图| 午夜影院久久久| 国产成人啪午夜精品网站男同| 欧美中文字幕一二三区视频| 日韩女优电影在线观看| 国产精品美女视频| 亚洲成人自拍偷拍| 国产成人综合亚洲91猫咪| 色综合中文字幕国产 | 久久先锋影音av| 亚洲欧美日韩中文播放| 日av在线不卡| av亚洲产国偷v产偷v自拍| 777亚洲妇女| 国产精品久久久久影院亚瑟 | 裸体一区二区三区| 成人午夜视频福利| 69p69国产精品| 国产精品久久午夜| 麻豆精品久久精品色综合| 一本色道久久综合狠狠躁的推荐| 日韩欧美一区在线观看| 亚洲精品国产精华液| 国产成人无遮挡在线视频| 在线播放91灌醉迷j高跟美女| 国产欧美精品国产国产专区| 五月天一区二区三区| 成人动漫视频在线| 精品国一区二区三区| 亚洲最新视频在线观看| 丰满少妇在线播放bd日韩电影| 日韩免费一区二区| 亚洲一区二区三区四区中文字幕| 国产盗摄一区二区三区| 日韩免费观看2025年上映的电影| 丁香天五香天堂综合| 91精选在线观看| 亚洲成av人片一区二区梦乃| 99久久国产免费看| 中文字幕精品一区| 国产在线看一区| 日韩一区二区三区视频在线 | 99久久国产综合色|国产精品| 精品免费一区二区三区| 天天操天天综合网| 欧美三级资源在线| 亚洲一区在线看| 91极品美女在线| 亚洲男女毛片无遮挡| www.亚洲精品| 国产精品色一区二区三区| 国产精品一品二品| 精品免费日韩av| 久久精品国产精品青草| 欧美一级在线观看| 日韩国产精品大片| 在线播放一区二区三区| 日韩精品午夜视频| 91精品黄色片免费大全| 免费成人结看片| 日韩欧美电影一区| 精品一区二区免费| 精品91自产拍在线观看一区| 九一久久久久久| 国产午夜亚洲精品不卡| 国产精品综合久久| 国产婷婷色一区二区三区四区| 国产精品一区二区在线播放 | 亚洲成人动漫av| 欧美日韩精品综合在线| 日本亚洲一区二区| 欧美α欧美αv大片| 韩国av一区二区三区四区| 久久精品亚洲国产奇米99| 成人永久看片免费视频天堂| 中文字幕制服丝袜成人av | 欧美一区二区在线免费播放| 日韩成人精品视频| 精品国产乱码久久久久久影片| 国产美女一区二区| 中文字幕免费一区| 91视频免费观看| 首页国产丝袜综合| www国产精品av| www.日韩在线| 五月激情综合婷婷| xnxx国产精品| 94色蜜桃网一区二区三区| 夜夜嗨av一区二区三区中文字幕 | 91在线小视频| 玉足女爽爽91| 欧美电视剧免费全集观看| 粉嫩av一区二区三区在线播放 |