Пример #1
0
        //TODO:Realese Spawning
        private void SpawnEnemy()
        {
            SpawnPlace place = RandomUtils.GetRandomEnemySpawnPlace();
            Vector2    pos   = GetSpawnPosition(place);

            if (IsAllowedSpawnPosition(pos))
            {
                spriteList.Add(new SmartTank(Default.GetEnemyTankSetting(Game, pos), Default.GetMissileSetting(Game)));
            }
        }
Пример #2
0
        /**
         * Будет ставить стрелу по координатам места в зависимости от направления
         */
        private void spawn()
        {
            // TODO comment what happened in #spawn
            SpawnPlace place = getSpawnPlace();

            x = place.x;
            y = place.y;
            switch (getDirection())
            {
            case 1:
            case 2:
                texture = images[0];
                break;

            case 3:
            case 4:
                texture = images[1];
                break;
            }
        }
Пример #3
0
        public Vector2 GetSpawnPosition(SpawnPlace place)
        {
            switch (place)
            {
            case SpawnPlace.TopLeft:
                return(LeftEnemyPosition);

            case SpawnPlace.TopMiddle:
                return(MiddleEnemyPosition);

            case SpawnPlace.TopRight:
                return(RightEnemyPosition);

            case SpawnPlace.BottomLeft:
                return(LeftUserPosition);

            case SpawnPlace.BottomRight:
                return(RightUserPosition);

            default:
                throw new PlaceNotFoundException();
            }
        }