示例#1
0
        /// <summary>
        /// 必要なコンテンツの読み込みを行います
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch           = new SpriteBatch(GraphicsDevice);
            Content.RootDirectory = @"Content\gameContent";
            Model model1 = this.Content.Load <Model> ("untitled");
            CharactorPalameter playerPara = new CharactorPalameter();

            playerPara.pos      = new Vector3(0);
            playerPara.Dir      = new Vector3(0, 0, 1);
            playerPara.MaxSpeed = 1;
            player  = new Player(this.Content.Load <Model>("untitled"), playerPara);
            enemies = new Enemies();
            CharactorPalameter planePara = new CharactorPalameter();

            planePara.pos = new Vector3(0, 0, 10);
            planePara.Dir = new Vector3(1, 0, 0);
            PlaneEnemy plane = new PlaneEnemy(this.Content.Load <Model>("untitled"), planePara);

            enemies.Add(plane);


            mainCamera = new PlayerCamera(player, MathHelper.ToRadians(45.0f),
                                          (float)this.GraphicsDevice.Viewport.Width /
                                          (float)this.GraphicsDevice.Viewport.Height);

            base.LoadContent();
        }
示例#2
0
 public Character(Model model, CharactorPalameter parameter)
 {
     this.model     = model;
     this.parameter = parameter;
     pos            = new Vector3(parameter.pos.X, parameter.pos.Y, parameter.pos.Z);
     dir            = new Vector3(parameter.Dir.X, parameter.Dir.Y, parameter.Dir.Z);
     position       = Matrix.CreateWorld(pos, dir, new Vector3(0, 1, 0));
     yz_rad         = Math.Asin(parameter.Dir.Y);
     xz_rad         = Math.Asin(parameter.Dir.X / Math.Sqrt(parameter.Dir.Z * parameter.Dir.Z + parameter.Dir.X * parameter.Dir.X));
     migration      = Vector3.Zero;
     return;
 }
示例#3
0
 public PlaneEnemy(Model model, CharactorPalameter parameter) : base(model, parameter)
 {
     speed = 1;
 }
示例#4
0
 protected Enemy(Model model, CharactorPalameter parameter) : base(model, parameter)
 {
 }
示例#5
0
 public Player(Model model, CharactorPalameter parameter)
     : base(model, parameter)
 {
     speed = parameter.MaxSpeed;
 }