Exemple #1
0
        /// <summary>
        /// Extracts the Animations from Take 001
        /// </summary>
        /// <param name="array containing the names of the animations"></param>
        /// <param name="array containing key ranges, eg 0-48,49-75 as [0,48,49,75]"></param>
        /// <param name="Model to be animated"></param>
        /// <param name="How many keyframes are baked into the model (generally if the last key is 11, this would be 10)"></param>
        /// <returns></returns>
        public DurationBasedAnimator.AnimationPackage generateAnimationPackage(int[] names, int[] keyRanges, Model m)
        {
            DurationBasedAnimator.AnimationPackage newPackage = new DurationBasedAnimator.AnimationPackage(((MeshMetadata)m.Tag).SkinningData, (float)keyRanges[keyRanges.Length - 1] - 1);

            for (int i = 0; i < names.Length; ++i)
            {
                newPackage.AddDurationClipEasy(names[i], keyRanges[i * 2], keyRanges[i * 2 + 1]);
            }


            return(newPackage);
        }
Exemple #2
0
        // Asset loading thread
        // Each asset updates the message and increments the load count
        private void LoadAssets()
        {
            // number of assets to be loaded. (used to compute progress bar size)
            num_assets  = 37;
            num_assets += CountSections();
            LoadSections();
            // assets
            mdl_menuscene = loadModel("models/menuscene/MenuScene");

            snd_game_music = Globals.content.Load <SoundEffect>("soundz/game/music/desolate");
            Globals.audioManager.LoadGameSound(snd_game_music, "music", 1, 1.0f, true);

            snd_pistol = Globals.content.Load <SoundEffect>("soundz/game/weapons/pistol");
            Globals.audioManager.LoadGameSound(snd_pistol, "pistol", 10, Globals.audioManager.pistol, false);

            snd_shottie = Globals.content.Load <SoundEffect>("soundz/game/weapons/shottie");
            Globals.audioManager.LoadGameSound(snd_shottie, "shottie", 5, Globals.audioManager.shottie, false);

            snd_sniper = Globals.content.Load <SoundEffect>("soundz/game/weapons/sniper");
            Globals.audioManager.LoadGameSound(snd_sniper, "sniper", 5, Globals.audioManager.sniper, false);

            snd_sword = Globals.content.Load <SoundEffect>("soundz/game/weapons/sword");
            Globals.audioManager.LoadGameSound(snd_sword, "sword", 5, Globals.audioManager.sword, false);

            snd_assault = Globals.content.Load <SoundEffect>("soundz/game/weapons/assault");
            Globals.audioManager.LoadGameSound(snd_assault, "assault", 15, Globals.audioManager.assault, false);

            snd_alien_death1 = Globals.content.Load <SoundEffect>("soundz/game/creatures/deathalien1");
            Globals.audioManager.LoadGameSound(snd_alien_death1, "aliendeath1", 6, Globals.audioManager.alienDeath1, false);

            snd_game_start = Globals.content.Load <SoundEffect>("soundz/game/ambience/begin");
            Globals.audioManager.LoadGameSound(snd_game_start, "start_game", 1, 1.0f, false);

            snd_bullet_impact1 = Globals.content.Load <SoundEffect>("soundz/game/weapons/bulletimpact1");
            Globals.audioManager.LoadGameSound(snd_bullet_impact1, "impact1", 4, 0.1f, false);

            snd_alien_bullet = Globals.content.Load <SoundEffect>("soundz/game/creatures/range_attack");
            Globals.audioManager.LoadGameSound(snd_alien_bullet, "alien_range", 15, Globals.audioManager.alienRange, false);

            //Load Character and animations
            mdl_character = loadModel("animatedmodels/player/spacemanAnimated");
            ani_character = generateAnimationPackage(Animation_States.characterAnimationsList, Animation_States.characterAnimationKeys, mdl_character);

            mdl_alien1 = loadModel("animatedmodels/alien01/alien01_2");
            ani_alien1 = generateAnimationPackage(Animation_States.alien01AnimationsList, Animation_States.alien01AnimationKeys, mdl_alien1);

            mdl_alien2 = loadModel("animatedmodels/alien02/alien02_2");
            ani_alien2 = generateAnimationPackage(Animation_States.alien02AnimationsList, Animation_States.alien02AnimationKeys, mdl_alien2);

            mdl_alien3 = loadModel("animatedmodels/alien03/alien03_2");
            ani_alien3 = generateAnimationPackage(Animation_States.alien03AnimationsList, Animation_States.alien03AnimationKeys, mdl_alien3);

            mdl_alien4 = loadModel("animatedmodels/alien04/alien04_2");
            ani_alien4 = generateAnimationPackage(Animation_States.alien04AnimationsList, Animation_States.alien04AnimationKeys, mdl_alien4);

            Animation_States.upperCharacterBones = new Dictionary <int, int>();

            for (int i = 1; i < 48; i++)
            {
                Animation_States.upperCharacterBones.Add(i, 1);
            }

            Animation_States.lowerCharacterBonesandRoot = new Dictionary <int, int>();
            Animation_States.lowerCharacterBonesandRoot.Add(0, 1);

            for (int i = 48; i < 70; ++i)
            {
                Animation_States.lowerCharacterBonesandRoot.Add(i, 1);
            }

            mdl_sphere        = loadModel("models/sphere");
            mdl_ceilinglight  = loadModel("models/ceilinglight/ceilinglight_model");
            mdl_filingcabinet = loadModel("models/filing/Filing");
            mdl_pistolBullet  = loadModel("projectiles/PistolBullet");

            mdl_shotgunBullet = loadModel("projectiles/ShotgunBullet");

            mdl_assaultBullet = loadModel("projectiles/AssaultBullet");
            mdl_sniper_bullet = loadModel("projectiles/SniperBullet");

            mdl_alien_projectile = loadModel("projectiles/AlienProjectile");

            mdl_dropfragment = loadModel("projectiles/DropFragment");

            mdl_doorPanel = loadModel("models/door/doorPanel");
            mdl_doorBase  = loadModel("models/door/doorBase");

            mdl_desk = loadModel("models/desk/Desk");

            mdl_pipe = loadModel("models/pipe/pipe");

            mdl_weapon_depot = loadModel("models/weapondepot/weaponDepot");

            mdl_assault_rifle = loadModel("models/weapons/assaultrifle/AssaultRifle");
            mdl_sniper_rifle  = loadModel("models/weapons/sniperrifle/SniperRifle");
            mdl_pistol        = loadModel("models/weapons/pistol/Pistol");
            mdl_shotgun       = loadModel("models/weapons/shotgun/Shottie");
            mdl_sword         = loadModel("models/weapons/sword/Sword");

            mdl_teleport_pad  = loadModel("models/teleportpad/teleportPad");
            mdl_teleport_beam = loadModel("models/teleportpad/teleportBeam");

            diamond = loadTexture("textures/diamond");

            //HUDs
            ammo         = loadTexture("textures/HUDs/ammo");
            pistol_blue  = loadTexture("textures/HUDs/pistol_blue");
            pistol_green = loadTexture("textures/HUDs/pistol_green");
            shot_blue    = loadTexture("textures/HUDs/shot_blue");
            shot_green   = loadTexture("textures/HUDs/shot_green");
            rifle_blue   = loadTexture("textures/HUDs/rifle_blue");
            rifle_green  = loadTexture("textures/HUDs/rifle_green");
            sniper_blue  = loadTexture("textures/HUDs/sniper_blue");
            sniper_green = loadTexture("textures/HUDs/sniper_green");
            sword_blue   = loadTexture("textures/HUDs/sword_blue");
            sword_green  = loadTexture("textures/HUDs/sword_green");


            //adding diagrams
            controller   = Globals.content.Load <Texture2D>("textures/xbox_controller_diagram");
            keyboard     = Globals.content.Load <Texture2D>("textures/keyboard_controller_diagram");
            group        = Globals.content.Load <Texture2D>("textures/group_small");
            questionRect = Globals.content.Load <Texture2D>("textures/question");

            ship = loadTexture("textures/spaceship");
            won  = loadTexture("textures/won");
            lost = loadTexture("textures/lost");

            //subheadings
            controls = Globals.content.Load <Texture2D>("textures/Headings/controls");
            about    = Globals.content.Load <Texture2D>("textures/Headings/about");
            paused   = Globals.content.Load <Texture2D>("textures/Headings/gamepaused");
            settings = Globals.content.Load <Texture2D>("textures/Headings/settings");

            // once its loaded, fade out
            StartTransitionOff();
        }