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

📄 platform.java

📁 一个很不错的炸弹人J2ME游戏源码.画面及音效质量都不错,可供新手学习使用.
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 

package bombjack;

import gamelib.GameObject;
import javax.microedition.lcdui.Graphics;

public class Platform extends GameObject
{

    public static final int palette1[] = {
        0xffff00, 0xffdd00, 0xffbb00, 0xff9900, 0xff7700, 0xff5500, 0xff3300
    };
    public static final int palette2[] = {
        65280, 60928, 52224, 43520, 34816, 26112, 17408
    };
    public static final byte HORIZONTAL = 1;
    public static final byte HORIZONTAL_BIG = 2;
    public static final byte VERTICAL_TN = 3;
    public static final byte VERTICAL_TL = 4;
    public static final byte VERTICAL_TR = 5;
    public static final byte VERTICAL_TB = 6;
    public static final byte VERTICAL_BN = 10;
    public static final byte VERTICAL_BL = 20;
    public static final byte VERTICAL_BR = 30;
    public static final byte VERTICAL_BB = 40;
    private byte type;
    private byte size;
    private byte level;

    public Platform(int i, int j, byte byte0, byte byte1, byte byte2)
    {
        super(i, j);
        type = byte1;
        size = byte0;
        level = byte2;
    }

    public void move(int i, int j)
    {
    }

    public void draw(Graphics g)
    {
        draw(g, x, y);
    }

    public void draw(Graphics g, int i, int j)
    {
        g.setClip(0, 0, 170, 182);
        boolean flag = false;
        if(type % 10 == 1)
        {
            for(int k = 0; k < 7; k++)
            {
                if(level % 10 == 1 || level % 10 == 6)
                    g.setColor(palette2[k]);
                else
                    g.setColor(palette1[k]);
                byte byte0;
                if(k == 6 || k == 0)
                    byte0 = 1;
                else
                    byte0 = 2;
                if(x == 0)
                    g.drawLine(i, j + k, ((i + size * 5) - 5) + byte0, j + k);
                else
                if(x + size * 5 >= 170)
                    g.drawLine((i + 5) - byte0, j + k, 170 + i, j + k);
                else
                    g.drawLine((i + 5) - byte0, j + k, ((i + size * 5) - 5) + byte0, j + k);
            }

        } else
        if(type % 10 == 2)
        {
            for(int l = 0; l < 7; l++)
            {
                if(level % 10 == 1 || level % 10 == 6)
                    g.setColor(palette2[l]);
                else
                    g.setColor(palette1[l]);
                byte byte1;
                if(l == 6 || l == 0)
                    byte1 = 2;
                else
                    byte1 = 3;
                if(x == 0)
                    g.drawLine(i, j + l, ((i + size * 5) - 5) + byte1, j + l);
                else
                if(x + size * 5 >= 170)
                    g.drawLine((i + 5) - byte1, j + l, 170 + i, j + l);
                else
                    g.drawLine((i + 5) - byte1, j + l, ((i + size * 5) - 5) + byte1, j + l);
            }

        } else
        {
            int ai[] = {
                1, 0, 0, 0, 0, 1
            };
            int ai1[] = {
                1, 0, 0, 0, 0, 1
            };
            if(type % 10 == 3)
                ai = (new int[] {
                    1, 0, 0, 0, 0, 1
                });
            else
            if(type % 10 == 4)
                ai = (new int[] {
                    6, 5, 4, 3, 1, 0
                });
            else
            if(type % 10 == 5)
                ai = (new int[] {
                    0, 0, 2, 3, 4, 5
                });
            else
            if(type % 10 == 6)
                ai = (new int[] {
                    -1, -2, -3, -3, -2, -1
                });
            if((type / 10) * 10 == 10)
                ai1 = (new int[] {
                    1, 0, 0, 0, 0, 1
                });
            else
            if((type / 10) * 10 == 20)
                ai1 = (new int[] {
                    6, 5, 4, 3, 1, 0
                });
            else
            if((type / 10) * 10 == 30)
                ai1 = (new int[] {
                    0, 1, 2, 4, 5, 6
                });
            else
            if((type / 10) * 10 == 40)
                ai1 = (new int[] {
                    -1, -2, -3, -3, -2, -1
                });
            if(type % 10 == 4 || (type / 10) * 10 == 20)
                i++;
            for(int i1 = 0; i1 < 6; i1++)
            {
                if(level % 10 == 1 || level % 10 == 6)
                    g.setColor(palette2[i1]);
                else
                    g.setColor(palette1[i1]);
                g.drawLine(i + i1 + 2, j + ai[i1], i + i1 + 2, (j + size * 7) - ai1[i1] - 1);
            }

        }
    }

    public int[][] getGridPos(int i, int j)
    {
        return (int[][])null;
    }

}

⌨️ 快捷键说明

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