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

📄 bobble.java

📁 K750手机游戏泡泡龙源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
//Download by http://www.codefans.net

public final class Bobble
{

    public static int aX;
    public static int aY;
    public static int aM;
    public static int aN;
    public static int nA;
    public static int mD;
    public static int aA[];
    private static int cX;
    private static int cY;
    private static int bX;
    private static int bY;
    private static int cL;
    private static int aG;
    private static Random rA;
    public static final int CO[] = {
        -994, -984, -970, -951, -927, -898, -866, -829, -788, -743,
        -694, -642, -587, -529, -469, -406, -342, -275, -207, -139,
        -69, 0, 69, 139, 207, 275, 342, 406, 469, 529,
        587, 642, 694, 743, 788, 829, 866, 898, 927, 951,
        970, 984, 994
    };
    public static final int SI[] = {
        -104, -173, -241, -309, -374, -438, -499, -559, -615, -669,
        -719, -766, -809, -848, -882, -913, -939, -961, -978, -990,
        -997, -1000, -997, -990, -978, -961, -939, -913, -882, -848,
        -809, -766, -719, -669, -615, -559, -499, -438, -374, -309,
        -241, -173, -104
    };

    public Bobble()
    {
    }

    private static int gA()
    {
        sCk();
        if(cL == 32)
            cL = 1;
        int i;
        do
            i = (rA.nextInt() >>> 1) % 6 + 1;
        while((cL & 1 << i - 1) == 0);
        return i;
    }

    private static void sbA()
    {
        boolean flag = false;
        boolean flag1 = false;
        boolean flag2 = false;
        for(int i4 = 0; i4 < 10; i4++)
        {
            int l3 = 0;
            if(aA[5 + 6 * i4] == -1)
                l3 = 1;
            for(int j4 = 0; j4 < 6; j4++)
            {
                int j = j4 + 6 * i4;
                int i = aA[j] & 0xf;
                if(aA[j] > 0 && i > 0)
                    if(j4 == 0)
                    {
                        int k = aA[j + 1] & 0xf;
                        if(k > 0)
                            aA[j] = aA[j] | 0x40000;
                        if(k == i)
                            aA[j] = aA[j] | 0x400;
                        if(i4 != 9)
                        {
                            int l = aA[j + 6 + l3] & 0xf;
                            if(l > 0)
                                aA[j] = aA[j] | 0x80000;
                            if(l == i)
                                aA[j] = aA[j] | 0x800;
                            if(l3 > 0)
                            {
                                int i1 = aA[j + 6] & 0xf;
                                if(i1 > 0)
                                    aA[j] = aA[j] | 0x100000;
                                if(i1 == i)
                                    aA[j] = aA[j] | 0x1000;
                            }
                        }
                        if(i4 > 0)
                        {
                            int j1 = aA[(j - 6) + l3] & 0xf;
                            if(j1 > 0)
                                aA[j] = aA[j] | 0x20000;
                            if(j1 == i)
                                aA[j] = aA[j] | 0x200;
                            if(l3 > 0)
                            {
                                int k1 = aA[j - 6] & 0xf;
                                if(k1 > 0)
                                    aA[j] = aA[j] | 0x10000;
                                if(k1 == i)
                                    aA[j] = aA[j] | 0x100;
                            }
                        }
                    } else
                    if(l3 > 0 && j4 == 4 || l3 == 0 && j4 == 5)
                    {
                        int l1 = aA[j - 1] & 0xf;
                        if(l1 > 0)
                            aA[j] = aA[j] | 0x200000;
                        if(l1 == i)
                            aA[j] = aA[j] | 0x2000;
                        if(i4 != 9)
                        {
                            int i2 = aA[j + 5 + l3] & 0xf;
                            if(i2 > 0)
                                aA[j] = aA[j] | 0x100000;
                            if(i2 == i)
                                aA[j] = aA[j] | 0x1000;
                            if(l3 > 0)
                            {
                                int j2 = aA[j + 6 + l3] & 0xf;
                                if(j2 > 0)
                                    aA[j] = aA[j] | 0x80000;
                                if(j2 == i)
                                    aA[j] = aA[j] | 0x800;
                            }
                        }
                        if(i4 > 0)
                        {
                            int k2 = aA[(j - 7) + l3] & 0xf;
                            if(k2 > 0)
                                aA[j] = aA[j] | 0x10000;
                            if(k2 == i)
                                aA[j] = aA[j] | 0x100;
                            if(l3 > 0)
                            {
                                int l2 = aA[(j - 6) + l3] & 0xf;
                                if(l2 > 0)
                                    aA[j] = aA[j] | 0x20000;
                                if(l2 == i)
                                    aA[j] = aA[j] | 0x200;
                            }
                        }
                    } else
                    {
                        int i3 = aA[j + 1] & 0xf;
                        if(i3 > 0)
                            aA[j] = aA[j] | 0x40000;
                        if(i3 == i)
                            aA[j] = aA[j] | 0x400;
                        i3 = aA[j - 1] & 0xf;
                        if(i3 > 0)
                            aA[j] = aA[j] | 0x200000;
                        if(i3 == i)
                            aA[j] = aA[j] | 0x2000;
                        if(i4 != 9)
                        {
                            int j3 = aA[j + 6 + l3] & 0xf;
                            if(j3 > 0)
                                aA[j] = aA[j] | 0x80000;
                            if(j3 == i)
                                aA[j] = aA[j] | 0x800;
                            j3 = aA[j + 5 + l3] & 0xf;
                            if(j3 > 0)
                                aA[j] = aA[j] | 0x100000;
                            if(j3 == i)
                                aA[j] = aA[j] | 0x1000;
                        }
                        if(i4 > 0)
                        {
                            int k3 = aA[(j - 6) + l3] & 0xf;
                            if(k3 > 0)
                                aA[j] = aA[j] | 0x20000;
                            if(k3 == i)
                                aA[j] = aA[j] | 0x200;
                            k3 = aA[(j - 7) + l3] & 0xf;
                            if(k3 > 0)
                                aA[j] = aA[j] | 0x10000;
                            if(k3 == i)
                                aA[j] = aA[j] | 0x100;
                        }
                    }
            }

        }

    }

    public static void init()
    {
        cL = 0;
        aG = 0;
        rA = new Random();
        aA = new int[60];
        nA = 0;
        int j = 11;
        for(int i = 0; i < 60; i++)
        {
            if(i < 18)
            {
                aA[i] = (rA.nextInt() >>> 1) % 3 + 1;
                nA++;
            } else
            {
                aA[i] = 0;
            }
            if(i == j)
            {
                if(aA[i] != 0)
                    nA--;
                aA[i] = -1;
                j += 12;
            }
        }

        sbA();
        aN = gA();
    }

    public static void sAID()
    {
        aX = 48;
        aY = 152;
        cX = aX * 1000;
        cY = aY * 1000;
        aM = aN;
        aN = gA();
    }

    public static int move()
    {
        byte byte0 = 2;
        int k = CO[mD];
        int l = SI[mD];
        cX += 1 * k;
        cY += 1 * l;
        aX = cX / 1000;
        aY = cY / 1000;
        bY = aY / 16;
        int i;
        if(aA[5 + 6 * bY] == -1)
        {
            i = 1;
            bX = (aX - 8) / 16;
        } else
        {
            i = 0;
            bX = aX / 16;
        }
        int j = bX + 6 * bY;
        if(mD != 21 && (bX > 0 && bX < 5 - i && aA[j - 1] > 0 && aA[j + 1] > 0 || i == 0 && bX == 0 && aA[j + 1] > 0 || i == 0 && bX == 5 && aA[j - 1] > 0))
        {
            aA[j] = aM;
            sbA();
            nA++;
            return 0;
        }
        int i1 = aX + 1;
        int j1 = aX - 1;
        int k1 = 89;
        byte byte1 = 7;
        if(i1 > k1 || j1 < byte1)
        {
            if(i1 > k1)
                aX = k1;
            if(j1 < byte1)
                aX = byte1 + 1;
            mD = 42 - mD;
            k = CO[mD];
            l = SI[mD];
            byte0 = 1;
        }
        if(aY - 1 < 15)
        {
            aY = 8;
            bY = aY / 16;
            if(aA[5 + 6 * bY] == -1)
                bX = (aX - 8) / 16;
            else
                bX = aX / 16;
            j = bX + 6 * bY;
            aA[j] = aM;
            sbA();
            nA++;
            return 0;
        }
        j = bX + 6 * bY;
        int l1 = (cY + 1 * l) / 1000 / 16;
        int i2;
        if(aA[5 + 6 * l1] == -1)
            i2 = ((cX + 1 * k) / 1000 - 8) / 16;
        else
            i2 = ((cX + 1 * k) / 1000 - 0) / 16;
        int j2 = i2 + 6 * l1;
        if(aA[j2] > 0)
        {
            if(aA[j] == -1)
            {
                if(aA[j - 1] > 0)
                {
                    bY++;
                    aA[j + 6] = aM;
                } else
                {
                    bX--;
                    aA[j - 1] = aM;
                }
            } else
            {
                aA[j] = aM;
            }
            sbA();
            nA++;
            return 0;
        }
        if(j2 > 0 && j2 < 59)
        {
            if((j + 1) % 6 == 0 || j % 6 == 0)
                return byte0;
            if(mD == 21 && (aA[j2 - 1] > 0 || aA[j2] > 0))
            {
                if(aA[5 + 6 * bY] == -1 && j2 == (j - 6) + 1 || aA[5 + 6 * bY] != -1 && j2 == j - 6)
                {
                    aA[j] = aM;
                    sbA();
                    nA++;
                    return 0;
                }
            } else
            if(mD > 21 && aA[j2] > 0)
            {
                if(aA[5 + 6 * bY] == -1 && j2 == (j - 6) + 1 || aA[5 + 6 * bY] != -1 && j2 == j - 6)
                {
                    aA[j] = aM;
                    sbA();
                    nA++;
                    return 0;
                }
            } else
            if(mD > 21 && aA[j2 - 1] > 0 && aA[j + 1] > 0)
            {
                if(aA[5 + 6 * bY] == -1 && j2 == (j - 6) + 1 || aA[5 + 6 * bY] != -1 && j2 == j - 6)
                {
                    aA[j] = aM;
                    sbA();
                    nA++;
                    return 0;
                }
            } else
            if(mD > 21 && aA[j2 - 1] > 0 && aA[j2 + 1] > 0)
            {
                if(aA[5 + 6 * bY] == -1 && j2 == (j - 6) + 1 || aA[5 + 6 * bY] != -1 && j2 == j - 6)
                {
                    aA[j2] = aM;
                    bY = l1;
                    bX = i2;
                    sbA();
                    nA++;
                    return 0;
                }
            } else
            if(mD < 21 && aA[j2] > 0)
            {
                if(aA[5 + 6 * bY] == -1 && j2 == j - 6 || aA[5 + 6 * bY] != -1 && j2 == j - 6 - 1)
                {
                    aA[j] = aM;
                    sbA();
                    nA++;
                    return 0;
                }
            } else
            if(mD < 21 && aA[j2 + 1] > 0 && aA[j - 1] > 0)
            {
                if(aA[5 + 6 * bY] == -1 && j2 == j - 6 || aA[5 + 6 * bY] != -1 && j2 == j - 6 - 1)
                {
                    aA[j] = aM;
                    sbA();

⌨️ 快捷键说明

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