Esempio n. 1
0
        public AmbientBubblesLogic(Character entity, int num, float life)
        {
            this.entity = entity;
            this.life = life;
            this.radius = new float[] { 0.3f, 0.6f, 1f, 1.5f };
            this.scale = new float[] { 0.05f, 0.07f, 0.09f, 0.11f };

            for (int i = 0; i < num; i++)
                Emit();
        }
Esempio n. 2
0
        public WormParticleLogic(Character entity, float life)
        {
            this.entity = entity;
            this.life = life;
            this.tail_logic = new SimpleParticleLogic();

            this.radius = new float[] { 15, 18, 20, 25 };
            this.scale = new float[] { 1.5f, 1.8f, 2.1f, 2.4f };
        }
Esempio n. 3
0
 public PopLogic(Character entity, float life)
 {
     this.entity = entity;
     this.life = life;
     this.radius = new float[] { 0.3f, 0.6f, 1f, 1.5f };
     this.scale = new float[] { 0.11f, 0.15f, 0.18f, 0.20f };
 }
Esempio n. 4
0
 public BubbleTailLogic(Character entity, float life)
 {
     this.entity = entity;
     this.life = life;
     this.radius = new float[] { 0.01f, 0.1f, 1f, 1.5f };
     this.scale = new float[] { 0.05f, 0.07f, 0.09f, 0.11f };
 }
Esempio n. 5
0
        public AmbientParticleLogic(Character entity, float life)
        {
            this.entity = entity;
            this.life = life;

            this.radius = new float[] { 15, 18, 20, 25 };
            this.scale = new float[] { 0.5f, 0.8f, 1f, 1.4f };
        }
Esempio n. 6
0
        public AmbientCircleParticleLogic(Character entity, float life)
        {
            this.entity = entity;
            this.life = life;

            this.radius = new float[] { 15, 18, 20, 25 };
            this.scale = new float[] { 10.5f, 12.5f, 15.5f, 20.5f };
        }
Esempio n. 7
0
        public void Add(Entity entity)
        {
            if (entities.Contains(entity))
                return;

            entities.Add(entity);

            if (entity is WallModelEntity)
            {
                WallModelEntity wallentity = entity as WallModelEntity;

                wallentity.BuildWall(plane);
                physics.Add(wallentity.body);
            }

            if (entity is Bubble)
            {
                Bubble bubble = entity as Bubble;
                physics.Add(bubble.body);
            }

            if (entity is Enemy)
            {
                Enemy enemy = entity as Enemy;
                physics.Add(enemy.body);
            }

            if (entity is Character)
                player = entity as Character;
        }
Esempio n. 8
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);
        }