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

📄 zbarrierobject.java

📁 java 编写的小游戏--坦克大战
💻 JAVA
字号:
// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2004-12-12 17:48:21
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   ZBarrierObject.java


public class ZBarrierObject extends ZObject
{

    void Setup(int i)
    {
        if(i == 1)
        {
            super.fVertices = new ZVertex[8];
            int j = 0;
            do
                super.fVertices[j] = new ZVertex();
            while(++j < 8);
            super.fVertices[0].SetLocal(20, -45, -20);
            super.fVertices[1].SetLocal(-20, -45, -20);
            super.fVertices[2].SetLocal(-20, -45, 20);
            super.fVertices[3].SetLocal(20, -45, 20);
            super.fVertices[4].SetLocal(25, 15, -25);
            super.fVertices[5].SetLocal(-25, 15, -25);
            super.fVertices[6].SetLocal(-25, 15, 25);
            super.fVertices[7].SetLocal(25, 15, 25);
            super.fNumVertices = 8;
            int ai[] = {
                1, 5, 4, 0, 1, 5, 4, 200, 0, 0, 
                4, 6, 2, 3, 7, 200, 0, 0, 4, 2, 
                1, 0, 3, 200, 0, 0, 4, 2, 6, 5, 
                1, 200, 0, 0, 4, 4, 7, 3, 0, 200, 
                0, 0
            };
            super.fShouldBeCheckForCollision = true;
            SetFacets(ai);
            SetRadius(45);
        }
        if(i == 0)
        {
            super.fVertices = new ZVertex[4];
            int k = 0;
            do
                super.fVertices[k] = new ZVertex();
            while(++k < 4);
            super.fVertices[0].SetLocal(25, 20, -20);
            super.fVertices[1].SetLocal(-25, 20, -20);
            super.fVertices[2].SetLocal(-25, 20, 20);
            super.fVertices[3].SetLocal(25, 20, 20);
            super.fNumVertices = 4;
            int ai1[] = {
                1, 1, 4, 3, 2, 1, 0, 250, 250, 250
            };
            super.fShouldBeCheckForCollision = false;
            super.fCanBeHitByPlayerBullet = true;
            SetFacets(ai1);
            SetRadius(25);
        }
    }

    public void Put(int i, int j, int k, int l, int i1, int j1, int k1)
    {
        Setup(k1);
        SetInitialTranslation(i, j, k);
        SetInitialAngle(l, i1, j1);
        ZObject.fWorld.Add(this);
    }

    public ZBarrierObject()
    {
        super.fX = super.fY = super.fZ = super.fSpeed = super.fXAngle = super.fYAngle = super.fZAngle = 0;
        super.fAction = 0;
        super.fStatus = 1;
        super.fExplodable = false;
        super.fCanBeHitByPlayerBullet = true;
        super.fType = 4;
    }

    public void DoAction()
    {
        if(super.fAction == 6)
        {
            super.fStatusTimer++;
            if(super.fStatusTimer > 10)
                super.fAction = 0;
        }
    }

    static final int FLAT = 0;
    static final int TOWER = 1;
}

⌨️ 快捷键说明

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