⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamescreen.java

📁 J2me游戏代码 J2me游戏代码 J2me游戏代码 J2me游戏代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
// FrontEnd Plus GUI for JAD
// DeCompiled : GameScreen.class
package game;

import java.util.Random;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.rms.RecordStore;

// Referenced classes of package game:
//            Image2, Object, Sound, MultiOutPut, 
//            game

class GameScreen extends GameCanvas
    implements Runnable
{

    static final byte ACC[] = {
        3, 5, 1
    };
    static final byte ARROW = 5;
    static final int ARROW_X1 = 1;
    static final int ARROW_X2 = 148;
    static final int ARROW_Y = 105;
    static final short BACK_X[] = {
        100, 100, 125, 110, 80, 90
    };
    static final short BACK_Y = 188;
    static final byte BANDEAU = 6;
    static final byte BEACH = 0;
    static final byte BG_1 = 10;
    static final byte BG_2 = 11;
    static final byte BG_3 = 12;
    static final byte BOOST = 20;
    static final byte CENTER = 3;
    static final byte CURSOR = 4;
    static final byte DECOR_1 = 16;
    static final byte DECOR_2 = 17;
    static final byte DECOR_HEIGHT[] = {
        74, 76, 64, 33, 67
    };
    static final byte DESERT = 1;
    static final byte DIR_LEFT = -1;
    static final byte DIR_RIGHT = 1;
    static final byte DRIVER = 9;
    static final byte FLAGS = 1;
    static final byte FONT_1 = 3;
    static final byte G_END = 4;
    static final byte G_INIT = 0;
    static final byte G_INTRO = 1;
    static final byte G_PAUSE = 3;
    static final byte G_PLAYING = 2;
    static final byte G_WIN = 5;
    static final byte HOLE = 18;
    static final byte ICE = 3;
    static final byte INTRO = 0;
    static final byte JUNGLE = 4;
    static final byte KARTS = 8;
    static final int KART_X_INIT = 32;
    static final byte KEY_DOWN = 3;
    static final byte KEY_LEFT = 4;
    static final byte KEY_NUM0 = 6;
    static final byte KEY_NUM1 = 7;
    static final byte KEY_NUM2 = 8;
    static final byte KEY_NUM3 = 9;
    static final byte KEY_NUM4 = 10;
    static final byte KEY_NUM5 = 11;
    static final byte KEY_NUM6 = 12;
    static final byte KEY_NUM7 = 13;
    static final byte KEY_NUM8 = 14;
    static final byte KEY_NUM9 = 15;
    static final byte KEY_OK = 18;
    static final byte KEY_POUND = 17;
    static final byte KEY_RIGHT = 5;
    static final byte KEY_SOFT1 = 0;
    static final byte KEY_SOFT2 = 1;
    static final byte KEY_STAR = 16;
    static final byte KEY_UP = 2;
    static final byte K_HEIGHT = 39;
    static final byte K_WIDTH = 50;
    static final byte K_WIDTH_2 = 25;
    static final byte LEFT_1 = 2;
    static final byte LEFT_2 = 1;
    static final byte LEFT_3 = 0;
    static final int LEFT_LIM = 30;
    static final int LEVEL_X_INIT = 12;
    static final short LOAD_Y = 93;
    static final byte MENU = 2;
    static final byte MOUNTAIN = 2;
    static final byte M_CHOOSE_KART = 7;
    static final byte M_CHOOSE_LANG = 8;
    static final byte M_CHOOSE_RACE = 6;
    static final byte M_CREDITS = 4;
    static final byte M_ENTER_SCORE = 5;
    static final byte M_HELP = 1;
    static final byte M_MAIN = 0;
    static final byte M_OPTIONS = 3;
    static final byte M_SCORES = 2;
    static final byte NB_DECOR = 3;
    static final byte NB_IMG = 25;
    static final byte NB_KEY = 19;
    static final byte NB_LAP = 3;
    static final byte NONE = 0;
    static final byte OBJ_HEIGHT[] = {
        22, 10, 19
    };
    static final byte OBJ_WIDTH[] = {
        55, 50, 30
    };
    static final byte OIL = 19;
    static final byte O_BOOST = 2;
    static final byte O_DEAD = 3;
    static final byte O_DECOR = 0;
    static final byte O_FINISH = 1;
    static final byte O_HOLE = 0;
    static final byte O_INIT = 0;
    static final byte O_MOVE = 1;
    static final byte O_OBJ = 2;
    static final byte O_OIL = 1;
    static final byte O_SUMO = 3;
    static final byte O_XPLODE = 2;
    static final short PAUSE_X = 116;
    static final short PAUSE_Y = 188;
    static final byte POSITION = 21;
    static final byte RIGHT_1 = 4;
    static final byte RIGHT_2 = 5;
    static final byte RIGHT_3 = 6;
    static final int RIGHT_LIM = 146;
    static final int ROAD_LEFT = 58;
    static final int ROAD_SIZE = 150;
    static final int ROAD_WIDTH = 60;
    static final int SCR_H = 204;
    static final int SCR_W = 176;
    static final byte SKY = 13;
    static final byte SMOKE = 24;
    static final byte SND_ZIK = 0;
    static final byte SPEED[] = {
        3, 2, 4
    };
    static final byte STARS = 7;
    static final byte START = 14;
    static final byte START_FIRE = 15;
    static final byte SUMO = 22;
    static final byte SUMO_HEIGHT = 41;
    static final int SUMO_TIME[] = {
        20, 25, 25, 25, 30
    };
    static final byte SUMO_WIDTH = 41;
    static final byte S_EXIT = 6;
    static final byte S_GAME = 5;
    static final byte S_INTRO = 0;
    static final byte S_LOAD_BEGIN = 1;
    static final byte S_LOAD_GAME = 2;
    static final byte S_LOAD_MENU = 3;
    static final byte S_MENU = 4;
    static final byte WEIGHT[] = {
        3, 2, 4
    };
    static final byte WIN = 23;
    static final int X_INIT = 88;
    static final int Y_INIT = 203;
    int _X;
    int _Y;
    int _acc;
    byte _anim;
    boolean _back;
    long _begin;
    int _bendLength;
    byte _boost;
    int _cptArrowLeft;
    int _cptArrowRight;
    int _cptBend;
    int _cptBoost;
    int _cptCurs;
    int _cptDecor;
    int _cptFinish;
    int _cptFps;
    int _cptLap;
    int _cptLetter;
    int _cptLoad;
    int _cptMain;
    int _cptObj;
    int _cptOff;
    int _cptRace;
    int _cptRoad;
    int _cptShake;
    int _cptStart;
    int _cptSumo;
    int _cptTurn;
    int _cptWin;
    byte _credit;
    byte _curs;
    byte _curvWanted;
    byte _curvX;
    Object _decor[];
    byte _dir;
    Image2 _efusion;
    boolean _enterScore;
    Object _finish;
    int _fps;
    int _gameState;
    byte _help;
    int _highScores[][];
    Image2 _img[];
    byte _isMusic;
    byte _isVibro;
    int _kart;
    boolean _kartMove;
    int _kartX;
    byte _keyMap[];
    byte _lang;
    byte _lap;
    byte _level;
    boolean _levelMove;
    byte _levelScore;
    int _levelX;
    byte _locked[];
    int _mainState;
    Image2 _media;
    byte _menuDir;
    int _menuState;
    boolean _musicLoaded;
    byte _names[][];
    byte _nbLetter;
    Object _obj;
    boolean _offRoad;
    boolean _ok;
    boolean _paint;
    byte _position;
    int _race[][] = {
        {
            70, 50, 3, 170, 40, -2, 230, 50, 3, 360, 
            40, 2, 440, 30, 3, 500, 30, -2, 560, 40, 
            3, 610, 0, 0
        }, {
            40, 40, -4, 100, 30, 3, 150, 30, 3, 230, 
            30, 3, 300, 30, -3, 350, 50, 4, 500, 40, 
            2, 550, 30, -2, 580, 30, 4, 660, 0, 0
        }, {
            30, 20, 2, 100, 30, 2, 160, 30, 3, 190, 
            30, -2, 270, 50, 3, 320, 40, 3, 390, 30, 
            -4, 460, 20, -2, 510, 40, 2, 560, 20, 3, 
            640, 0, 0
        }, {
            60, 40, 3, 160, 30, 3, 190, 40, -3, 280, 
            40, 4, 320, 40, -4, 380, 40, 4, 540, 40, 
            -2, 590, 30, 2, 660, 0, 0
        }, {
            40, 40, -4, 140, 50, 4, 260, 30, -4, 330, 
            50, 4, 410, 30, -2, 450, 50, 4, 550, 40, 
            -4, 640, 40, 3, 740, 40, 3, 870, 30, 2, 
            950, 60, 4, 1070, 30, -2, 1110, 0, 0
        }
    };
    Random _rand;
    byte _rebound;
    int _road[] = {
        120, 110, 100, 95, 85, 80, 75, 70, 65, 60, 
        57, 54, 51, 48, 45, 42, 39, 37, 35, 33, 
        31, 29, 27, 26, 25, 24, 23, 22, 21, 20, 
        19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 
        9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 
        0, 0, 0, 0, 0, 0, 0, 0
    };
    long _roadTime;
    byte _roadX;
    int _score;
    int _scroll;
    long _sec;
    byte _shakeY;
    boolean _showFPS;
    int _speed;
    int _speedMax;
    int _startX;
    int _startY;
    byte _statAcc;
    byte _statSpeed;
    byte _statWeight;
    Object _sumo;
    long _t;
    int _time;
    byte _tmpLetter[];
    int _tmpScore;
    int _weight;
    int _xLeft;
    int _xRight;
    int _yellow1[];
    int _yellow2[];
    long last_paint;
    game midlet;
    MultiOutPut mu;
    Sound music;

    public GameScreen(game game1)
    {
        super(false);
        mu = null;
        last_paint = 0L;
        _showFPS = false;
        _rand = null;
        _musicLoaded = false;
        _mainState = 0;
        setFullScreenMode(true);
        midlet = game1;
        GameInit();
        (new Thread(this)).start();
    }

    int Abs(int i)
    {
        int j;
        if(i >= 0)
            j = i;
        else
            j = 0 - i;
        return j;
    }

    void Draw_Arrows(Graphics g)
    {
        if(_cptArrowLeft == 0)
        {
            Graphics _tmp = g;
            Graphics _tmp1 = g;
            _img[5].drawFrame(g, 1, 105, 1, 16 + 4);
        } else
        {
            Graphics _tmp2 = g;
            Graphics _tmp3 = g;
            _img[5].drawFrame(g, 1, 105, 0, 16 + 4);
        }
        if(_cptArrowRight == 0)
        {
            Graphics _tmp4 = g;
            Graphics _tmp5 = g;
            _img[5].drawFrame(g, 148, 105, 2, 16 + 4);
        } else
        {
            Graphics _tmp6 = g;
            Graphics _tmp7 = g;
            _img[5].drawFrame(g, 148, 105, 3, 16 + 4);
        }
        if(_cptArrowLeft > 0)
        {
            _cptArrowLeft++;
            if(_cptArrowLeft > 10)
                _cptArrowLeft = 0;
        }
        if(_cptArrowRight > 0)
        {
            _cptArrowRight++;
            if(_cptArrowRight > 10)
                _cptArrowRight = 0;
        }
    }

    void Draw_Game(Graphics g)
    {
        g.setClip(0, 0, 176, 204);
        Graphics _tmp = g;
        Graphics _tmp1 = g;
        _img[13].draw(g, 0, 0, 16 + 4);
        switch(_level)
        {
        case 0: // '\0'
            g.setColor(0xffabd1ff);
            g.fillRect(0, 58, 176, 50);
            Graphics _tmp2 = g;
            Graphics _tmp3 = g;
            _img[12].draw(g, 0, 67, 16 + 4);
            Graphics _tmp4 = g;
            Graphics _tmp5 = g;
            _img[12].draw(g, 106, 67, 16 + 4);
            Graphics _tmp6 = g;
            Graphics _tmp7 = g;
            _img[11].drawFrame(g, 0, 94, (_cptMain % 4) / 2, 16 + 4);
            Graphics _tmp8 = g;
            Graphics _tmp9 = g;
            _img[11].drawFrame(g, 122, 94, (_cptMain % 4) / 2, 16 + 4);
            g.setClip(0, 0, 176, 204);
            Graphics _tmp10 = g;
            Graphics _tmp11 = g;
            _img[10].draw(g, _scroll, 88, 16 + 4);
            Graphics _tmp12 = g;
            Graphics _tmp13 = g;
            _img[10].draw(g, _scroll + 187, 88, 16 + 4);
            g.setColor(-5344);
            g.fillRect(0, 150, 176, 54);
            break;

        case 1: // '\001'
            g.setColor(0xfff9c503);
            g.fillRect(0, 58, 176, 30);
            Graphics _tmp14 = g;
            Graphics _tmp15 = g;
            _img[11].draw(g, 0, 64, 16 + 4);
            Graphics _tmp16 = g;
            Graphics _tmp17 = g;
            _img[11].draw(g, 139, 64, 16 + 4);
            Graphics _tmp18 = g;
            Graphics _tmp19 = g;
            _img[10].draw(g, _scroll, 88, 16 + 4);
            Graphics _tmp20 = g;
            Graphics _tmp21 = g;
            _img[10].draw(g, _scroll + 189, 88, 16 + 4);
            g.setColor(-2775);
            g.fillRect(0, 150, 176, 54);
            break;

        case 2: // '\002'
            g.setColor(0xffabd1ff);
            g.fillRect(0, 58, 176, 30);
            Graphics _tmp22 = g;
            Graphics _tmp23 = g;
            _img[11].draw(g, 0, 70, 16 + 4);
            Graphics _tmp24 = g;
            Graphics _tmp25 = g;
            _img[10].draw(g, _scroll - 132, 111, 16 + 4);
            Graphics _tmp26 = g;
            Graphics _tmp27 = g;
            _img[10].draw(g, _scroll, 111, 16 + 4);
            Graphics _tmp28 = g;
            Graphics _tmp29 = g;
            _img[10].draw(g, _scroll + 132, 111, 16 + 4);
            g.setColor(0xff1ebd38);
            g.fillRect(0, 150, 176, 54);
            break;

        case 3: // '\003'

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -