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

📄 landscape.java

📁 超级玛丽的源代码
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Landscape.java

import java.util.Hashtable;
import java.util.Vector;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

public class Landscape
{    
	public char matrix[][];
    private Main main;
    private GameFC gameFC;
    public int xF;
    public int yF;
    public int w;
    public int h;
    private Image bricks[];
    private int skinT;

    public Landscape(Main main1, char ac[][], GameFC gamefc)
    {
        w = 15;
        h = 10;
        skinT = 0;
        main = main1;
        matrix = ac;
        gameFC = gamefc;
        xF = 0;
        yF = (65 - ac[0].length * h) * 10;
        bricks = new Image[10];
        Image image = (Image)main1.cache.get("bricks.png");
        for(int i = 0; i < bricks.length; i++)
            bricks[i] = main1.extractFrame(image, w, h, i);

    }

    public void paint(Graphics g)
    {
        int i;
        int j;
        int k;
        skinT++;
        if(skinT > 10)
            skinT = 0;
        i = -yF / h / 10;
        j = -xF / w / 10;
        k = i;
          goto _L1
_L21:
        int l = j;
          goto _L2
_L19:
        char c = matrix[l][k];
        c;
        JVM INSTR tableswitch 68 120: default 529
    //                   68 364
    //                   69 480
    //                   70 342
    //                   71 432
    //                   72 504
    //                   73 529
    //                   74 529
    //                   75 529
    //                   76 529
    //                   77 529
    //                   78 529
    //                   79 529
    //                   80 529
    //                   81 529
    //                   82 529
    //                   83 456
    //                   84 384
    //                   85 529
    //                   86 529
    //                   87 322
    //                   88 529
    //                   89 408
    //                   90 529
    //                   91 529
    //                   92 529
    //                   93 529
    //                   94 529
    //                   95 529
    //                   96 529
    //                   97 529
    //                   98 529
    //                   99 529
    //                   100 529
    //                   101 529
    //                   102 316
    //                   103 529
    //                   104 529
    //                   105 529
    //                   106 529
    //                   107 529
    //                   108 529
    //                   109 529
    //                   110 529
    //                   111 529
    //                   112 529
    //                   113 529
    //                   114 370
    //                   115 377
    //                   116 529
    //                   117 529
    //                   118 529
    //                   119 310
    //                   120 304;
           goto _L3 _L4 _L5 _L6 _L7 _L8 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L9 _L10 _L3 _L3 _L11 _L3 _L12 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L13 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L3 _L14 _L15 _L3 _L3 _L3 _L16 _L17
_L3:
        continue; /* Loop/switch isn't completed */
_L17:
        byte byte0;
        byte0 = 0;
        break; /* Loop/switch isn't completed */
_L16:
        byte0 = 1;
        break; /* Loop/switch isn't completed */
_L13:
        byte0 = 2;
        break; /* Loop/switch isn't completed */
_L11:
        if(skinT < 5)
            byte0 = 3;
        else
            byte0 = 4;
        break; /* Loop/switch isn't completed */
_L6:
        if(skinT < 5)
            byte0 = 7;
        else
            byte0 = 8;
        break; /* Loop/switch isn't completed */
_L4:
        byte0 = 5;
        break; /* Loop/switch isn't completed */
_L14:
        byte0 = 6;
        break; /* Loop/switch isn't completed */
_L15:
        byte0 = 9;
        break; /* Loop/switch isn't completed */
_L10:
        new GroundEnemy(1, l, k, main, gameFC);
        continue; /* Loop/switch isn't completed */
_L12:
        int i1;
        int j1;
        try
        {
            new GroundEnemy(2, l, k, main, gameFC);
        }
        catch(Exception exception) { }
        continue; /* Loop/switch isn't completed */
_L7:
        new GroundEnemy(3, l, k, main, gameFC);
        continue; /* Loop/switch isn't completed */
_L9:
        new GroundEnemy(4, l, k, main, gameFC);
        continue; /* Loop/switch isn't completed */
_L5:
        new GroundEnemy(5, l, k, main, gameFC);
        continue; /* Loop/switch isn't completed */
_L8:
        new GroundEnemy(6, l, k, main, gameFC);
        continue; /* Loop/switch isn't completed */
        i1 = xF / 10 + l * w;
        j1 = yF / 10 + k * h;
        g;
        g;
        g.drawImage(bricks[byte0], i1, j1, 0x10 | 4);
        l++;
_L2:
        if(l < j + 8) goto _L19; else goto _L18
_L18:
        k++;
_L1:
        if(k < i + 7) goto _L21; else goto _L20
_L20:
    }

    public int[] getPosition(int i, int j)
    {
        int k = (-xF / 10 + i) / w;
        int l = (-yF / 10 + j) / h;
        return (new int[] {
            k, l
        });
    }

    public void scroll(int i, int j)
    {
        xF += i;
        yF += j;
        gameFC.mario.xF += i;
        gameFC.mario.yF += j;
        int k = gameFC.turtles.size();
        for(int l = 0; l < k; l++)
        {
            GroundEnemy groundenemy = (GroundEnemy)gameFC.turtles.elementAt(l);
            groundenemy.xF += i;
            groundenemy.yF += j;
        }

    }

    public void touch()
    {
        Mario mario = gameFC.mario;
        int ai[] = getPosition(mario.xF / 10 + mario.w / 2, (mario.yF / 10 + mario.h) - mario.h / 4);
        int i = ai[0];
        int j = ai[1];
        char c = matrix[i][j];
        switch(c)
        {
        case 70: // 'F'
        case 87: // 'W'
        case 119: // 'w'
            gameFC.dead = true;
            break;

        case 68: // 'D'
            gameFC.completed = true;
            break;
        }
    }

    public boolean isEmpty(int i, int j)
    {
        switch(matrix[i][j])
        {
        case 46: // '.'
        case 68: // 'D'
        case 70: // 'F'
        case 87: // 'W'
        case 119: // 'w'
            return true;
        }
        return false;
    }


}

⌨️ 快捷键说明

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