Ejemplo n.º 1
0
 public CompactZone(Texture2D texture, Vector2 position, DrawingHelper.DrawingLevel drawingLevel, Game game, World world, Color color, Library.Zone.Name shape)
     : base(texture, position, drawingLevel, game, world, color)
 {
     _game           = game;
     Tag             = TagCategories.COMPACTZONE;
     _isShot         = false;
     _shape          = shape;
     _tail           = null;
     _detonationTime = 70;
     _timer          = _detonationTime;
 }
Ejemplo n.º 2
0
        public void CreateZone(Library.Zone.Name zoneshape, Vector2 position, float rotation, Color color)
        {
            switch (zoneshape)
            {
            case Library.Zone.Name.Circle:
                CircleZone circleZ = new CircleZone(Library.Zone.Texture[shape], ConvertUnits.ToDisplayUnits(position), rotation, color, Game, _world);
                _zones.Add(circleZ);
                SyncedGameCollection.ComponentCollection.Add(circleZ);
                break;

            case Library.Zone.Name.Triangle:
                TriangleZone triangleZ = new TriangleZone(Library.Zone.Texture[shape], ConvertUnits.ToDisplayUnits(position), rotation, color, Game, _world);
                _zones.Add(triangleZ);
                SyncedGameCollection.ComponentCollection.Add(triangleZ);
                break;

            //case Library.Zone.Name.Square:
            //    SquareZone squareZ = new SquareZone(Library.Zone.Texture[shape], ConvertUnits.ToDisplayUnits(position), rotation, color, Game, _world);
            //    _zones.Add(squareZ);
            //    SyncedGameCollection.ComponentCollection.Add(squareZ);
            //    break;
            case Library.Zone.Name.Pentagon:
                PentagonZone pentagonZ = new PentagonZone(Library.Zone.Texture[shape], ConvertUnits.ToDisplayUnits(position), rotation, color, Game, _world);
                _zones.Add(pentagonZ);
                SyncedGameCollection.ComponentCollection.Add(pentagonZ);
                break;

            case Library.Zone.Name.Hexagon:
                HexagonZone hexagonZ = new HexagonZone(Library.Zone.Texture[shape], ConvertUnits.ToDisplayUnits(position), rotation, color, Game, _world);
                _zones.Add(hexagonZ);
                SyncedGameCollection.ComponentCollection.Add(hexagonZ);
                break;

            default:
                break;
            }
            Library.Audio.PlaySoundEffect(Library.Audio.SoundEffects.ZoneExpand);
        }
Ejemplo n.º 3
0
        public Player(PlayerIndex playerIndex, Library.Character.Name character, Library.Colors.ColorName teamcolor, Game game, World world, Vector2 positionLeft, Vector2 positionRight)
            : base(game)
        {
            // TODO: fix hardcode positions.
            _playerIndex = playerIndex;

            Left  = new Unit(playerIndex, Library.Character.GameTexture[character], positionLeft, Library.Colors.getColor[Tuple.Create(teamcolor, Library.Colors.ColorVariation.Left)], game, world, teamcolor);      // TODO: fix hardcoded values for positions.
            Right = new Unit(playerIndex, Library.Character.GameTexture[character], positionRight, Library.Colors.getColor[Tuple.Create(teamcolor, Library.Colors.ColorVariation.Right)], game, world, teamcolor);

            _areTrailsActive      = false;
            _haveSwitched         = false;
            _world                = world;
            _barrier              = new Barrier(Library.Particle.barrierParticle, Left, Right, world, game, Library.Colors.getColor[Tuple.Create(teamcolor, Library.Colors.ColorVariation.Other)]);
            shape                 = (Library.Zone.Name)character;
            _teamColor            = teamcolor;
            _compactZones         = new List <CompactZone>();
            _zones                = new List <Zone>();
            _zoneCreationCooldown = 10.0f;
            _canCreateZone        = true;

            SyncedGameCollection.ComponentCollection.Add(Left);
            SyncedGameCollection.ComponentCollection.Add(Right);
            SyncedGameCollection.ComponentCollection.Add(_barrier);
        }