コード例 #1
0
    void AlienBattle(AlienType type)
    {
        string t = type.ToString();

        PlayerPrefs.SetString("ALIEN_KEY", t);
        SceneManager.LoadScene("ARCombat");
    }
コード例 #2
0
ファイル: speedup-BackHit.cs プロジェクト: mumumumu/SpeedUp
 public BackHit( GameWorld world, Texture2D texture, Vector2 position, float size,
     AlienType type, String texturename = TNames.plated_alien )
     : base(world, texture, position, size,
     type, texturename: texturename, ai: AlienController.AIType.BOSS)
 {
     m_restitution = 1.2f;
     m_alien_color = Color.Aquamarine;
 }
コード例 #3
0
ファイル: SpawnData.cs プロジェクト: KenLSM/TowerDefense
 public Spawn(GameObject _Alien, Vector2 _Pos, float _SpawnDelay)
 {
     Alien = _Alien;
     Position = _Pos;
     _Type = Alien.GetComponent<AlienBase>().Type;
     SpawnDelay = _SpawnDelay;
     Spawned = false;
 }
コード例 #4
0
 public AlienTypeGetter()
 {
     alienTypes    = new AlienType[4];
     alienTypes[0] = new AlienType(1, 2, Color.red);
     alienTypes[1] = new AlienType(2, 2, Color.yellow);
     alienTypes[2] = new AlienType(3, 1, Color.blue);
     alienTypes[3] = new AlienType(4, 1, Color.green);
 }
コード例 #5
0
ファイル: speedup-Spawner.cs プロジェクト: mumumumu/SpeedUp
 public Spawner( GameWorld world, Texture2D texture, Vector2 position, float size,
     AlienType type, int cooldown, String texturename = TNames.easy_alien, int max_spawn = DEFAULT_MAX_SPAWN, AlienController.AIType ai = AlienController.AIType.PATROL, float patrol = 0.05f )
     : base(world, texture, position, size, type, ai: ai, patrol_speed: patrol)
 {
     m_texture_name = texturename;
     max_cool = cooldown;
     m_cooldown = cooldown;
     m_alien_color = Color.Red;
     m_max_spawn = max_spawn;
 }
コード例 #6
0
ファイル: speedup-MultiHit.cs プロジェクト: mumumumu/SpeedUp
 public MultiHit( GameWorld world, Texture2D texture, Vector2 position, float size,
     AlienType type, int hits, String texturename = TNames.plated_alien )
     : base(world, texture, position, size, type, ai: AlienController.AIType.CHASER)
 {
     max_hit = hits;
     hit_counter = hits;
     m_restitution = 1;
     m_texture_name = texturename;
     m_texture = texture;
 }
コード例 #7
0
    private void SetAlienType()
    {
        AlienType alienType = alienTypeGetter.GetRandomAlienType();

        TypeID = alienType.typeId;
        Lifes  = alienType.lifes;
        Color  = alienType.color;

        sprite.color = Color;
    }
コード例 #8
0
 public AlienSpecies GetAlien(AlienType alienType)
 {
     foreach (var alien in Aliens)
     {
         if (alien.AlienType == alienType)
         {
             return(alien);
         }
     }
     return(null);
 }
コード例 #9
0
    // Start is called before the first frame update
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        AlienType newAlien;
        Dictionary <string, float> rNeeds;

        // Need 1 of each
        rNeeds = new Dictionary <string, float>()
        {
            { "Raw Meat", 1.8f }, { "Sodium", 1.8f }, { "Sulphur", 1.8f }, { "Iron", 1.8f }
        };
        newAlien = new AlienType(0, rNeeds, 60);
        alienLevels.Add(newAlien);

        // Need 2 meat, 3 Na, 1 Cl, 3 Su
        rNeeds = new Dictionary <string, float>()
        {
            { "Raw Meat", 1.2f }, { "Sodium", 1.3f }, { "Chlorine", 1f }, { "Sulphur", 1.3f }
        };
        newAlien = new AlienType(1, rNeeds, 90);
        alienLevels.Add(newAlien);

        // Need 2 meats, 3 Na, 2 NaCl, 3 Cl
        rNeeds = new Dictionary <string, float>()
        {
            { "Cooked Meat", 0.9f }, { "Sodium", 1 }, { "Salt", 0.9f }, { "Chlorine", 1 }
        };
        newAlien = new AlienType(2, rNeeds, 120);
        alienLevels.Add(newAlien);

        // Need 3 raw meat, 3 cooked meat, 6 Na, 2 fire
        rNeeds = new Dictionary <string, float>()
        {
            { "Raw Meat", 1 }, { "Cooked Meat", 1 }, { "Sodium", 1.5f }, { "Fire", 1.1f }
        };
        newAlien = new AlienType(3, rNeeds, 120);
        alienLevels.Add(newAlien);

        // Need 6 NaCl, 4 Cl, 4 Su, 10 Fire
        rNeeds = new Dictionary <string, float>()
        {
            { "Salt", 0.9f }, { "Chlorine", 0.75f }, { "Sulphur", 0.75f }, { "Fire", 1.3f }
        };
        newAlien = new AlienType(4, rNeeds, 180);
        alienLevels.Add(newAlien);

        currentLevel = 0;
        CompleteLevel();
    }
コード例 #10
0
ファイル: speedup-TwinNova.cs プロジェクト: mumumumu/SpeedUp
 public TwinNova( GameWorld world, Texture2D texture, Vector2 position, float size,
     AlienType type, int deathtime, int hits, String texturename = TNames.blue_nova )
     : base(world, texture, position, size, type)
 {
     cooldown = deathtime;
     m_deathtime = deathtime;
     max_hit = hits;
     hit_counter = hits;
     m_restitution = 1.5f;
     m_texture_name = texturename;
     m_texture = texture;
 }
コード例 #11
0
    protected GameObject CreateAlienByType(AlienType alienType)
    {
        switch (alienType)
        {
        case AlienType.ALIEN_ZAKO:
            return(Instantiate(alienKinds[0]));

        case AlienType.ALIEN_GOEI:
            return(Instantiate(alienKinds[1]));

        default:
            return(null);
        }
    }
コード例 #12
0
    void SpawnAlien()
    {
        AlienType type   = (AlienType)(int)UnityEngine.Random.Range(0, Enum.GetValues(typeof(AlienType)).Length);
        float     newLat = tileManager.getLat + UnityEngine.Random.Range(-0.0007f, 0.0007f);
        float     newLon = tileManager.getLon + UnityEngine.Random.Range(-0.0007f, 0.0007f);

        Aliens prefab = Resources.Load("MapAlien/" + type.ToString(), typeof(Aliens)) as Aliens;
        Aliens alien  = Instantiate(prefab, Vector3.zero, Quaternion.identity) as Aliens;

        alien.tileManager = tileManager;
        alien.Init(newLat, newLon);

        aliens.Add(alien);
    }
コード例 #13
0
 public Alien(AlienType type, Point startPosition, int column, int row)
 {
     CurrentPosition   = startPosition;
     (_still, _moving) = type switch
     {
         AlienType.Crab =>
         (new Sprite(0, 0, 20, 12), new Sprite(20, 0, 40, 14)),
         AlienType.Octopus =>
         (new Sprite(20, 14, 40, 26), new Sprite(0, 12, 20, 27)),
         _ => (new Sprite(0, 27, 20, 41), new Sprite(20, 27, 40, 41)),
     };
     _current   = _still;
     _explosion = new Sprite(0, 59, 17, 69);
     Column     = column;
     Row        = row;
 }
コード例 #14
0
ファイル: speedup-Queen.cs プロジェクト: mumumumu/SpeedUp
        public Queen( GameWorld world, Texture2D texture, Vector2 position, float size,
            AlienType type, int cooldown, String texturename = TNames.queen_alien, int max_spawn = 10 )
            : base(world, texture, position, size,
            type, cooldown, texturename: texturename, max_spawn: max_spawn, ai: AlienController.AIType.BOSS, patrol: 0.03f)
        {
            m_alien_color = Color.White;
            m_restitution = 2f;
            for ( int i = 0; i < 4; i++ ) {
                eggs[i] = new Egg();
                eggs[i].intact = true;
                eggs[i].pos = Vector2.Zero;
            }

            eggs[0].pos += new Vector2( 9, -4 );
            eggs[0].angle = 1.35f;
            eggs[1].pos += new Vector2( 7, -10 );
            eggs[1].angle = 0.65f;

            eggs[2].pos += new Vector2( -9, -4 );
            eggs[2].angle = -1.35f;
            eggs[3].pos += new Vector2( -7, -10 );
            eggs[3].angle = -0.65f;
        }
コード例 #15
0
ファイル: TopicView.cs プロジェクト: jmfb/XComGenerations
		private void AddTopicControls(AlienType alien)
		{
			var metadata = alien.Metadata();
			AddControl(new Label(24, 5, metadata.Name, Font.Large, ColorScheme.LightAqua));
			AddControl(new Overlay(metadata.Overlay));
			var nextTop = 40;
			foreach (var descriptionLine in metadata.DescriptionLines)
			{
				var top = nextTop;
				nextTop += 8;
				AddControl(new Label(top, 5, descriptionLine, Font.Normal, ColorScheme.LightPurple));
			}
		}
コード例 #16
0
ファイル: Alien.cs プロジェクト: Elideb/SpaceInvaders
 public Alien(AlienColumn column, AlienType type, Vector2 position, Vector2 size)
     : base(position, size)
 {
     Column = column;
     Type = type;
 }
コード例 #17
0
ファイル: TopicType.cs プロジェクト: jmfb/XComGenerations
 private static TopicMetadata Alien(AlienType alien)
 {
     return new TopicMetadata
     {
         Name = alien.Metadata().Name,
         Category = TopicCategory.AlienLifeForms,
         Scheme = ColorScheme.LightWhite,
         RequiredResearch = new[] { alien.Metadata().RequiredResearch },
         Subject = alien
     };
 }
コード例 #18
0
 public void SetAlienType(AlienType type)
 {
     alienType = type;
 }
コード例 #19
0
ファイル: Ufo.cs プロジェクト: jmfb/XComGenerations
        public static Ufo Create(
			UfoType ufoType,
			UfoStatus status,
			AlienType alienType,
			AlienMissionType mission,
			RegionType region)
        {
            var ufo = new Ufo
            {
                UfoType = ufoType,
                Status = status,
                Number = GameState.Current.Data.NextUfoNumber++,
                AlienType = alienType,
                Mission = mission,
                Region = region
            };
            GameState.Current.Data.Ufos.Add(ufo);
            return ufo;
        }
コード例 #20
0
ファイル: speedup-Alien.cs プロジェクト: mumumumu/SpeedUp
        // The Alien Constructor
        //
        // <param name="world"> The World this object would be contained inside </param>
        // <param name="texture"> The image that governs the shape of this object</param>
        // <param name="velocity"> The initial velocity from throwing</param>
        // <param name="density"> The object's mass per unit area </param>
        // <param name="friction"> Usually set to 0 for throwable objects, but sliding factor </param>
        // <param name="restitution"> Bounciness </param>
        public Alien( GameWorld world, Texture2D texture, Vector2 position, float size,

            AlienType type, AlienCollisionType collision_type = AlienCollisionType.NORMAL,
            String name = "Alien", String texturename = TNames.easy_alien, AlienController.AIType ai = AlienController.AIType.PEON,

            int attack_rate = 50, float attack_power = 10, int attack_cooldown = 120,
            float laser_slowdown = 0.8f,

            float patrol_speed = ALIEN_PATROL_SPEED, float max_range = TUTORIAL_MAX_RANGE,
            float attack_dist = TUTORIAL_ATTACK_RANGE, float chase_dist = TUTORIAL_MAX_CHASE,

            float destroy_threshold = 30,

            float rotation = 0.0f, float density = ALIEN_DENSITY, float friction = ALIEN_FRICTION,
            float restitution = ALIEN_RESTITUTION, float attack_speed = 1.0f )
            : base(world, texture, position, density, friction,
            restitution, ALIEN_DAMPING, rotation: rotation, name: name,
            is_destructible: true, radius: size)
        {
            m_laser_slowdown = laser_slowdown;
            m_ai_type = ai;
            m_destroy_threshold = destroy_threshold;

            m_move_step = patrol_speed;
            m_range = max_range;
            m_attack_dist = attack_dist;
            m_chase_dist = chase_dist;
            m_attack_speed = attack_speed;

            m_size_scale = (float)Math.Sqrt( size );
            m_laser_texture = TestWorld.laser_texture;
            m_attack_rate = attack_rate;                    // Will likely change
            m_attack_power = attack_power;                    // Will likely change
            m_is_attacking = false;
            m_attack_cooldown = attack_cooldown;
            m_width = ( m_size_scale ) * (float)texture.Width / ( GameWorld.SCALE );
            m_height = ( m_size_scale ) * (float)texture.Height / ( GameWorld.SCALE );

            m_radius = Math.Min( m_width, m_height ) / 2;
            m_size = m_radius;
            m_texture_name = texturename;
            m_width_height = new Vector2( m_width, m_height );
            m_type = type;
            m_collision_type = collision_type;
            m_animation_frame = 1;
            m_last_destroy_frame = false;
            m_ai_control = new AlienController( m_world, this, m_ai_type, m_world.m_ninja
                    , patrol_speed: m_move_step, max_range: m_range,
                    attack_dist: m_attack_dist, chase_dist: m_chase_dist );
            m_alien_color = Color.White;
            set_textures();
        }
コード例 #21
0
 public CharacterInfo GetFor(AlienType alienType)
 {
     return(_infos[alienType]);
 }