public Shockwave(Device device)
 {
     this.device = device;
     shockWaveMesh = new PositionedMesh(device, MediaUtilities.FindFile("shockwave.x"));
     shockWaveMesh.Position.Location = new Vector3(0, 0, 0);
     shockWaveMesh.Position.Rotate(0,0,10);
 }
示例#2
0
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");
        playerShip  = new Ship(device, this, HullColors.White);
    }
示例#3
0
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");

        HullColors hullColor = HullColors.White;

        playerShip = new Ship(device, this, hullColor);
        if (playerShip.HostName == null)
        {
            playerShip.HostName = "Player";
        }
        playerShip.State = ShipState.Normal;

        HullColors opponentHullColor;

        if (hullColor == HullColors.Red)
        {
            opponentHullColor = HullColors.White;
        }
        else
        {
            opponentHullColor = HullColors.Red;
        }

        opponentShip = new Ship(device, this, opponentHullColor);
        if (opponentShip.HostName == null)
        {
            opponentShip.HostName = "Opponent";
        }
        opponentShip.State = ShipState.Normal;
    }
示例#4
0
 public Shockwave(Device device)
 {
     this.device   = device;
     shockWaveMesh = new PositionedMesh(device, MediaUtilities.FindFile("shockwave.x"));
     shockWaveMesh.Position.Location = new Vector3(0, 0, 0);
     shockWaveMesh.Position.Rotate(0, 0, 10);
 }
示例#5
0
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);
        camera.Point(0, 5, -30, 0, 0, 0);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");
        playerShip  = new PositionedMesh(device, "WhiteShip.x");
    }
    public Photon(Device device)
    {
        this.device = device;

        photonMesh = new PositionedMesh(device, "photon.x");

        alive = false;
        age = 0;
    }
示例#7
0
    public Photon(Device device)
    {
        this.device = device;

        photonMesh = new PositionedMesh(device, "photon.x");

        alive = false;
        age   = 0;
    }
    private float waitCount = 6.0f; // wait count before state transition.

    #endregion Fields

    #region Constructors

    public Ship(Device device, GameClass gameClass, HullColors hullColor)
    {
        this.device = device;
        this.game = gameClass;
        shots = new Shots(device);
        if (hullColor == HullColors.White) {
            shipMesh = new PositionedMesh(device, "WhiteShip.x");
            startingPosition = new Vector3(10, 0, 10);
        }
        else {
            shipMesh = new PositionedMesh(device, "RedShip.x");
            startingPosition = new Vector3(-50, 0, -150);
        }
        SetRandomPosition(true);
    }
示例#9
0
 public Ship(Device device, GameClass gameClass, HullColors hullColor)
 {
     this.device = device;
     this.game   = gameClass;
     shots       = new Shots(device);
     if (hullColor == HullColors.White)
     {
         shipMesh         = new PositionedMesh(device, "WhiteShip.x");
         startingPosition = new Vector3(10, 0, 10);
     }
     else
     {
         shipMesh         = new PositionedMesh(device, "RedShip.x");
         startingPosition = new Vector3(-50, 0, -150);
     }
     SetRandomPosition(true);
 }
    private float waitCount = 6.0f; // wait count before state transition.

    #endregion Fields

    #region Constructors

    public Ship(Device device, GameClass gameClass, HullColors hullColor)
    {
        this.device = device;
        this.game = gameClass;
        shots = new Shots(device);
        if (hullColor == HullColors.White) {
            shipMesh = new PositionedMesh(device, "WhiteShip.x");
            startingPosition = new Vector3(10, 0, 10);
        }
        else {
            shipMesh = new PositionedMesh(device, "RedShip.x");
            startingPosition = new Vector3(-50, 0, -150);
        }
        vaporTrail = new ParticleEffects(device);
        vaporTrail.ParticleTexture = TextureLoader.FromFile(device,
            MediaUtilities.FindFile("particle-blue.bmp"));

        SetRandomPosition(true);
    }
示例#11
0
 public Ship(Device device, GameClass gameClass, HullColors hullColor)
 {
     this.device = device;
     this.game   = gameClass;
     shots       = new Shots(device);
     if (hullColor == HullColors.White)
     {
         shipMesh         = new PositionedMesh(device, "WhiteShip.x");
         startingPosition = new Vector3(10, 0, 10);
     }
     else
     {
         shipMesh         = new PositionedMesh(device, "RedShip.x");
         startingPosition = new Vector3(-50, 0, -150);
     }
     vaporTrail = new ParticleEffects(device);
     vaporTrail.ParticleTexture = TextureLoader.FromFile(device,
                                                         MediaUtilities.FindFile("particle-blue.bmp"));
     shockWave = new Shockwave(device);
     SetRandomPosition(true);
 }
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");

        HullColors hullColor = HullColors.White;

        playerShip = new Ship(device, this, hullColor);
        if (playerShip.HostName == null)
        {
            playerShip.HostName = "Player";
        }
        playerShip.State = ShipState.Normal;

        HullColors opponentHullColor;

        if (hullColor == HullColors.Red)
        {
            opponentHullColor = HullColors.White;
        }
        else
        {
            opponentHullColor = HullColors.Red;
        }

        opponentShip = new Ship(device, this, opponentHullColor);
        if (opponentShip.HostName == null)
        {
            opponentShip.HostName = "Opponent";
        }
        opponentShip.State = ShipState.Normal;

        bgPointer   = new BGPointer(device);
        vectorPanel = TextureLoader.FromFile(device, MediaUtilities.FindFile("vectorPanel.png"));
        rts         = new RenderToSurface(device, 128, 128, Format.X8R8G8B8, true, DepthFormat.D16);
    }
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");

        HullColors hullColor = HullColors.White;
        playerShip = new Ship(device, this, hullColor);
        if (playerShip.HostName == null)
            playerShip.HostName = "Player";
        playerShip.State = ShipState.Normal;

        HullColors opponentHullColor;
        if (hullColor == HullColors.Red)
            opponentHullColor = HullColors.White;
        else
            opponentHullColor = HullColors.Red;

        opponentShip = new Ship(device, this, opponentHullColor);
        if (opponentShip.HostName == null)
            opponentShip.HostName = "Opponent";
        opponentShip.State = ShipState.Normal;
    }
 public BGPointer(Device device)
 {
     this.device = device;
     arrowMesh = new PositionedMesh(device,"arrow-yel.x");
     arrowMesh.Position.Scale(2.0f, 2.0f, 2.0f);
 }
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");

        playerShip = new Ship(device, this, hullColor);
        if (playerShip.HostName == null)
            playerShip.HostName = "Player";
        playerShip.State = ShipState.Normal;

        HullColors opponentHullColor;
        if (hullColor == HullColors.Red)
            opponentHullColor = HullColors.White;
        else
            opponentHullColor = HullColors.Red;

        opponentShip = new Ship(device, this, opponentHullColor);
        if (opponentShip.HostName == null)
            opponentShip.HostName = "Opponent";
        opponentShip.State = ShipState.Normal;

        bgPointer = new BGPointer(device);
        vectorPanel = TextureLoader.FromFile(device, MediaUtilities.FindFile("vectorPanel.png"));

        rts = new RenderToSurface(device, 128, 128, Format.X8R8G8B8, true, DepthFormat.D16);
    }
示例#16
0
 public BGPointer(Device device)
 {
     this.device = device;
     arrowMesh   = new PositionedMesh(device, "arrow-yel.x");
     arrowMesh.Position.Scale(2.0f, 2.0f, 2.0f);
 }
 /// <summary>
 /// Initialize scene objects.
 /// </summary>
 protected override void InitializeDeviceObjects()
 {
     drawingFont.InitializeDeviceObjects(device);
     spaceSphere = new PositionedMesh(device, "SpaceSphere.x");
 }
示例#18
0
 /// <summary>
 /// Initialize scene objects.
 /// </summary>
 protected override void InitializeDeviceObjects()
 {
     drawingFont.InitializeDeviceObjects(device);
     spaceSphere = new PositionedMesh(device, "SpaceSphere.x");
 }
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);
        camera.Point(0,5,-30,0,0,0);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");
        playerShip = new PositionedMesh(device, "WhiteShip.x");
    }
    /// <summary>
    /// Initialize scene objects.
    /// </summary>
    protected override void InitializeDeviceObjects()
    {
        drawingFont.InitializeDeviceObjects(device);

        spaceSphere = new PositionedMesh(device, "SpaceSphere.x");
        playerShip = new Ship(device, this, HullColors.White);
    }