Beispiel #1
0
 public static void swapDrawDepth(int newDepth, Actors.CActor sprite)
 {
     if (_currentMap != null)
     {
         _currentMap.swapDrawDepth(newDepth, sprite);
     }
 }
Beispiel #2
0
        private void _swapMap()
        {
            _currentMap = mapPool[_mapName];
            CMasterControl.commNet.Clear();
            _currentMap.registerWithCommNet();


            Actors.CActor actor      = setActorToFollow(_actorToFollow);
            Vector3       cameraDiff = new Vector3(-CMasterControl.camera.position.X - _followerCoords.X, -CMasterControl.camera.position.Y - _followerCoords.Y, 0);

            CMasterControl.camera.jump(Vector3.Zero);
            CMasterControl.camera.translate(new Vector3(100 - _followerCoords.X, 60 - _followerCoords.Y, 0));
            CMasterControl.camera.setBoundary(_followerCoords);

            if (!string.IsNullOrWhiteSpace(_currentMap.bgmRef))
            {
                CMasterControl.audioPlayer.addSfx(CMasterControl.audioPlayer.soundBank[_currentMap.bgmRef]);
            }

            actor.position = _followerCoords;
            _setCameraLimit(actor);
            _mapSwapIssued = false;

            _roomStart = true;
        }
Beispiel #3
0
        private static void _setCameraLimit(Actors.CActor follower)
        {
            Actors.CActor[] limiters = _currentMap.queryActorRegistry(typeof(Actors.Collision.CCameraLimit));
            CMasterControl.camera.cameraLimit = null;

            foreach (Actors.CActor limiter in limiters)
            {
                Actors.Collision.CCameraLimit limit = (Actors.Collision.CCameraLimit)limiter;

                if (limit.isPointWithin(follower.position))
                {
                    CMasterControl.camera.cameraLimit = limit;
                    break;
                }
            }
        }
Beispiel #4
0
        //builds a new component from the given actors
        public static void addComponent(Actors.CActor root, Dictionary <string, Actors.CActor> actors)
        {
            if (root == null)
            {
                throw new KotException.KotInvalidActorException("Root actor cannot be null when calling addComponent");
            }

            Actors.CComponent component = new Actors.CComponent(_currentMap.largestAddress + 1);
            component.layer = root.layer;

            addComponent(component);
            addActorToComponent(root, component.address);

            if (actors != null)
            {
                foreach (Actors.CActor actor in actors.Values)
                {
                    addActorToComponent(actor, component.address);
                }
            }
        }
Beispiel #5
0
 public void swapDrawDepth(int newDepth, Actors.CActor sprite)
 {
     _layers[sprite.layer].swapDrawDepth(newDepth, sprite);
 }
Beispiel #6
0
 public void addToDrawList(Actors.CActor actor)
 {
     _drawlist.addSpriteToList(actor.drawDepth, actor);
 }
Beispiel #7
0
 public void removeFromDrawList(Actors.CActor actor)
 {
     _drawlist.removeSpriteFromDrawList(actor);
 }
Beispiel #8
0
 public void swapDrawDepth(int newDepth, Actors.CActor sprite)
 {
     _drawlist.changeSpriteDepth(sprite, sprite.drawDepth, newDepth);
 }
Beispiel #9
0
 public static void addActorToComponent(Actors.CActor actor, int componentAddress)
 {
     _currentMap.addActorToComponent(actor, componentAddress);
 }
Beispiel #10
0
 public static void removeFromActorRegistry(Actors.CActor actor)
 {
     _currentMap.removeFromActorRegistry(actor);
 }