Esempio n. 1
0
        protected override void LoadContent()
        {
            Resources.Load(content);

            input = new MultiInputDevice(PlayerIndex.One);
            //input = new GamePadDevice(PlayerIndex.One);

            game = new Hyades(input);
            screenmanager = new ScreenManager(input);
            gamescreen = new GameScreen(game, screenmanager);
            screenmanager.FadeIn(gamescreen);
            Title logo = new Title(gamescreen, screenmanager);
            screenmanager.FadeIn(logo);
            /*

            editor = new Editor(input);
            screenmanager = new ScreenManager(input);
            editorscreen = new EditorScreen(editor, screenmanager);
            screenmanager.FadeIn(editorscreen);
            */
        }
Esempio n. 2
0
        public Hyades(InputDevice input)
        {
            this.input = input;
            instance = this;

            background_music = Resources.background_music.CreateInstance();
            background_music.IsLooped = true;
            background_music.Play();

            player = new Player(input);
            player.position.Z = 2.0f;

            camera = new FirstPersonCamera(player);
            camera.width = Application.WIDTH;
            camera.height = Application.HEIGHT;
            camera.near = 0.1f;
            camera.far = 500;
            camera.fov = 1.1f;

            level = new Level();
            level.Load();

            Skybox skybox = new Skybox(player);
            level.Add(skybox);

            StaticModelEntity birthstone = new StaticModelEntity(Resources.rock_model);
            birthstone.position = Vector3.Zero;
            birthstone.rotation.X = 1.11592329f;
            birthstone.rotation.Y = 0.188416481f;
            birthstone.rotation.Z = 1.31485772f;
            birthstone.size = new Vector3(0.0006f);
            AmbientEntityBubblesLogic birthstone_logic = new AmbientEntityBubblesLogic(birthstone, 80, 10);
            level.Add(birthstone);

            for (int i = 0; i < 10; i++)
            {
                Bubble bubble = new Bubble(0.03f + (float)rand.NextDouble()*0.02f);
                bubble.SetPosition(new Vector2(-50000, 0));
                bubble.SetVelocity(new Vector2(0, -1.0f));
                level.Add(bubble);
            }

            Enemy enemy;
            for (int i = 0; i < 2; i++)
            {
                enemy = new Fish();
               // enemy.size *= 0.1f;
                enemy.size *= (((float)rand.NextDouble())) * 0.06f + 0.05f;
               // enemy.size.Z *= 0.2f;
                //enemy.position.Z = (((float)rand.NextDouble()) -0.5f)*2;
                enemy.SetPosition(new Vector2(-50000, 0));
                level.Add(enemy);
            }

            for (int i = 0; i < 1; i++)
            {
                enemy = new Octopus();
                enemy.size *= 0.1f;
                enemy.SetPosition(new Vector2(-50000, -10));
                level.Add(enemy);
            }

            character = new Character(player, input);
            character.SetPosition(new Vector2(0, 0));
            level.Add(character);
            Enemy.player = character;

            particlemanager = ParticleManager.GetInstance();

            AmbientParticleLogic ambient_logic = new AmbientParticleLogic(character, 10);

            for (int i = 0; i < 400; i++)
            {
                ambient_logic.Emit();
            }

            AmbientCircleParticleLogic ambient_circle_logic = new AmbientCircleParticleLogic(character, 20);

            for (int i = 0; i < 10; i++)
            {
                ambient_circle_logic.Emit();
            }

            WormParticleLogic worm_logic = new WormParticleLogic(character, 10);

            for (int i = 0; i < 20; i++)
            {
                worm_logic.Emit();
            }

            Update(0);
        }