public override void Initialize(TGCGame game)
 {
     foreach (Weapon weapon in Weapons)
     {
         weapon.Initialize(game);
     }
     base.Initialize(game);
 }
示例#2
0
 public void Update(TGCGame tgcGame)
 {
     timer -= 0.5f;
     if (enemies > 0 && timer == 0)
     {
         tgcGame.AddEnemy(Position);
         enemies -= 1;
         timer    = 300;
     }
 }
 public Floor(TGCGame game) : base(game)
 {
     Effect  = Game.Content.Load <Effect>(ContentFolderEffects + "PlatformShader");
     Texture = Game.Content.Load <Texture2D>(ContentFolderTextures + "Platform");
     Cube    = Game.Content.Load <Model>(ContentFolder3D + "geometries/cube");
     foreach (ModelMesh mesh in Cube.Meshes)
     {
         foreach (var part in mesh.MeshParts)
         {
             part.Effect = Effect;
         }
     }
 }
        public override void Initialize(TGCGame game)
        {
            is_initialized = true;
            Scale          = Matrix.CreateScale(-0.05f);

            float distInFrontOfCam  = 0f;
            float upOrDownOffset    = 5f;
            float leftOrRightOffset = 15f;

            Matrix cameraWorld = Matrix.Invert(MapRepo.CurrentMap.Camera.View);

            cameraWorld.Translation += (cameraWorld.Forward * distInFrontOfCam) + (cameraWorld.Up * upOrDownOffset) + (cameraWorld.Right * leftOrRightOffset);

            World = Scale * cameraWorld;
            base.Initialize(game);
        }
        public Player(TGCGame game, Camera camera, float yPosition = 0, Matrix?scaling = null)
        {
            this.Camera  = camera;
            NewPosition  = Camera.Position + new Vector3(0, yPosition, 0);
            UpVertex     = NewPosition + HitboxSize;
            BottomVertex = NewPosition - HitboxSize;

            // Remover
            Weapons = new List <Weapon>();
            Weapon machineGun = new MachineGun();
            Weapon handgun    = new Handgun();
            Weapon rpg7       = new Rpg7();
            Weapon shotgun    = new Shotgun();

            Weapons.Add(handgun);
            Weapons.Add(machineGun);
            Weapons.Add(shotgun);
            Weapons.Add(rpg7);
            CurrentWeapon = Weapons[0];
        }
        static public Map Level1(TGCGame game, GraphicsDevice graphicsDevice)
        {
            var builder = new MazeBuilder(10, 10, new Vector3(250, 100, 250));

            var wallsEffect = new BasicEffect(graphicsDevice);

            wallsEffect.TextureEnabled = true;
            wallsEffect.Texture        = ContentManager.Instance.LoadTexture2D("Wall/Wall2");
            var floorEffect = new BasicEffect(graphicsDevice);

            floorEffect.TextureEnabled = true;
            floorEffect.Texture        = ContentManager.Instance.LoadTexture2D("Checked-Floor/Checked-Floor");
            var ceilingEffect = new BasicEffect(graphicsDevice);

            ceilingEffect.TextureEnabled = true;
            ceilingEffect.Texture        = ContentManager.Instance.LoadTexture2D("ceiling/Ceiling");
            var ceilingTexture = (ceilingEffect, (1f, 1f));
            var floorTexture   = (floorEffect, (1f, 1f));
            var wallTexture    = (wallsEffect, (1f, 1f));
            var leftFront      = new Dictionary <WallId, (BasicEffect, (float, float))> {
                { WallId.Ceiling, ceilingTexture }, { WallId.Floor, floorTexture }, { WallId.Front, wallTexture }, { WallId.Left, wallTexture }
        public override void Initialize(TGCGame game)
        {
            HitboxSize      = new Vector3(25, 25, 25);
            CurrentPosition = SpawnPoint;
            LastPosition    = CurrentPosition;
            current_scale   = 10f;
            // current_scale = 220f;
            is_initialized = true;
            Scale          = Matrix.CreateScale(current_scale);

            float distInFrontOfCam  = 0f;
            float upOrDownOffset    = 5f;
            float leftOrRightOffset = 15f;

            Matrix cameraWorld = Matrix.Invert(MapRepo.CurrentMap.Camera.View);

            cameraWorld.Translation += (cameraWorld.Forward * distInFrontOfCam) + (cameraWorld.Up * upOrDownOffset) + (cameraWorld.Right * leftOrRightOffset);
            cameraWorld              = Matrix.CreateTranslation(SpawnPoint) * Matrix.CreateTranslation(0, -20, 0);
            Position = cameraWorld;
            World    = Scale * cameraWorld;
            base.Initialize(game);
        }
        public override void Initialize(TGCGame game)
        {
            _game = game;
            base.Initialize(game);

            Player.Initialize(game);

            foreach (var room in Rooms)
            {
                room.Initialize(game);
            }

            Array.ForEach(Enemies, (enemy) => {
                enemy.Initialize(game);
                if (enemy.PositionSet())
                {
                    return;
                }
                this.SetPositionOfEnemy(enemy);
            });

            UI.Initialize(game);
        }
 public override void Initialize(TGCGame game)
 {
     World = Matrix.CreateScale(0.1f);
     base.Initialize(game);
 }
 public override void Initialize(TGCGame game)
 {
     default_rotation = RotationMatrix;
     World            = Matrix.CreateScale(0.1f);
     base.Initialize(game);
 }