Exemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public PrisonGame()
        {
            // XNA startup
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Create objects for the parts of the ship
            for(int i=1;  i<=6;  i++)
            {
                phibesModel.Add(new PrisonModel(this, i));
            }

            // Create a player object
            player = new Player(this);

            // Some basic setup for the display window
            this.IsMouseVisible = true;
            this.Window.AllowUserResizing = true;
            this.graphics.PreferredBackBufferWidth = 1024;
            this.graphics.PreferredBackBufferHeight = 728;

            // Basic camera settings
            camera = new Camera(graphics);
            camera.FieldOfView = MathHelper.ToRadians(60);
            camera.Eye = new Vector3(800, 180, 1053);
            camera.Center = new Vector3(275, 90, 1053);
            lineDraw = new PSLineDraw(this, Camera);
            this.Components.Add(lineDraw);
        }
Exemplo n.º 2
0
 public AnimatedModel(PrisonGame game, string asset,Player play)
 {
     playInfo = play;
     this.game = game;
     this.asset = asset;
     skinTransforms = new Matrix[57];
     for (int i = 0; i < skinTransforms.Length; i++)
     {
         skinTransforms[i] = Matrix.Identity;
     }
 }
Exemplo n.º 3
0
        public Interface(PrisonGame game, Player player, int playerControllerIndex)
        {
            this.game = game;
            this.player = player;

            if (playerControllerIndex == 1)
            {
                index = PlayerIndex.One;
            }
            else if (playerControllerIndex == 2)
            {
                index = PlayerIndex.Two;
            }
            else if (playerControllerIndex == 3)
            {
                index = PlayerIndex.Three;
            }
            else if (playerControllerIndex == 4)
            {
                index = PlayerIndex.Four;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public PrisonGame()
        {
            // XNA startup
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            skybox = new Skybox(this);
            // Camera settings

            camera1 = new Camera(graphics);
            camera1.Eye = new Vector3(800, 180, 1053);
            camera1.Center = new Vector3(275, 90, 1053);
            camera1.FieldOfView = MathHelper.ToRadians(42);

            camera2 = new Camera(graphics);
            camera1.Eye = new Vector3(800, 180, 1053);
            camera1.Center = new Vector3(275, 90, 1053);
            camera1.FieldOfView = MathHelper.ToRadians(42);

            ground = new Ground(this);

            // Create a player object
            player = new Player(this, camera1);
            player2.Location = new Vector3(0, 0, 0);
            player2 = new Player(this, camera2);
            player2.Location = new Vector3(0,0, 100);

            //Particle system
            smokePlume = new SmokeParticleSystem3d(9);

            // Some basic setup for the display window
            this.IsMouseVisible = true;
            //this.Window.AllowUserResizing = true;
            this.graphics.PreferredBackBufferWidth = 1024;
            this.graphics.PreferredBackBufferHeight = 768;

            lineDraw = new PSLineDraw(this, Camera);
            this.Components.Add(lineDraw);
        }
Exemplo n.º 5
0
        public bool PlayerIsFacing(Player player, string door)
        {
            Vector3 doorLocation = Vector3.Zero;
            foreach (PrisonModel model in phibesModel)
            {
                Vector3 coords = model.GetDoorLocation(door);
                if (coords != Vector3.Zero)
                {
                    doorLocation = coords;
                }
            }

            Vector3 playerLocation = player.getLocation();

            Vector3 playerFacing = player.getFacing();
            playerFacing.Normalize();

            Vector3 doorDirectionFromPlayer = doorLocation - playerLocation;
            doorDirectionFromPlayer.Normalize();

            int playerFacingSign = (int)Math.Round(MostSignificant(playerFacing));
            int appopriateFacingSign = (int)Math.Round(MostSignificant(doorDirectionFromPlayer));

            return playerFacingSign == appopriateFacingSign;
        }
Exemplo n.º 6
0
 public Bazooka(Player player)
 {
     this.player = player;
 }
Exemplo n.º 7
0
Arquivo: Dalek.cs Projeto: ksuh90/P3
 /// <summary>
 /// Initializes a new instance of the <see cref="Locust" /> class.
 /// This function creates Bat, given the game supplied
 /// </summary>
 /// <param name="game"></param>
 public Dalek(PrisonGame p_game, Player p_player)
 {
     game = p_game;
     player = p_player;
 }