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

📄 zbulletobject.java

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


public class ZBulletObject extends ZObject
{

    public ZBulletObject()
    {
        super.fAction = 1;
        super.fStatus = 1;
        super.fExplodable = false;
        super.fCanBeHitByPlayerBullet = false;
        super.fShouldBeCheckForCollision = true;
    }

    public void LaunchEnemyBullet(int i, int j, int k, int l, int i1, int j1)
    {
        super.fType = 5;
        super.fEnergy = 20;
        Setup();
        SetInitialTranslation(i, j, k);
        SetSpeed(10);
        SetInitialAngle(l, i1, j1);
        SetMaxLifeTime(50);
        ZObject.fWorld.Add(this);
    }

    void Setup()
    {
        super.fVertices = new ZVertex[4];
        int i = 0;
        do
            super.fVertices[i] = new ZVertex();
        while(++i < 4);
        super.fVertices[0].SetLocal(5, 0, 0);
        super.fVertices[1].SetLocal(-5, 0, 0);
        super.fVertices[2].SetLocal(0, 0, 5);
        super.fVertices[3].SetLocal(0, -5, 0);
        super.fNumVertices = 4;
        char c;
        char c1;
        if(super.fType == 0)
        {
            i = 200;
            c = '\310';
            c1 = '\310';
        } else
        {
            i = 255;
            c = '\377';
            c1 = '\0';
        }
        int ai[] = {
            1, 4, 3, 2, 1, 3, i, c, c1, 3, 
            0, 3, 1, i, c, c1, 3, 2, 3, 0, 
            i, c, c1, 3, 0, 1, 2, i, c, c1
        };
        SetFacets(ai);
    }

    public void LaunchPlayerBullet(int i, int j, int k, int l, int i1, int j1)
    {
        super.fType = 0;
        super.fEnergy = 20;
        Setup();
        SetInitialTranslation(i, j, k);
        SetSpeed(20);
        SetInitialAngle(l, i1, j1);
        SetMaxLifeTime(50);
        ZObject.fWorld.Add(this);
    }
}

⌨️ 快捷键说明

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