예제 #1
0
        public SlimeActor(ActorManager actorManager, BasicActorConstruction basicActorConstruction)
        {
            _actorManager = actorManager;

            switch (basicActorConstruction.ActorConstructionType)
            {
            case BasicActorConstructionType.SlimeActive:
                _actionState   = ActionState.SquishInPlace;
                _aiSwitchTimer = 120;

                Clipping = false;

                _renderVector.X = basicActorConstruction.X;
                _renderVector.Y = basicActorConstruction.Y;

                _textureClipping.X      = 16;
                _textureClipping.Y      = 0;
                _textureClipping.Width  = 16;
                _textureClipping.Height = 16;

                TextureKey = TextureKey.Slime;

                X1 = basicActorConstruction.X + 4;
                X2 = basicActorConstruction.X + 12;
                Y1 = basicActorConstruction.Y + 8;
                Y2 = basicActorConstruction.Y + 16;
                break;

            default:
                throw new ActorConstructionTypeNotImplementedException("Slime actor does not implement " + basicActorConstruction.ActorConstructionType.ToString());
            }
        }
예제 #2
0
        public BlockActor(BasicActorConstruction actorConstruction)
        {
            switch (actorConstruction.ActorConstructionType)
            {
            case BasicActorConstructionType.DungeonBlock_01:
                Clipping = true;

                X1 = actorConstruction.X;
                X2 = actorConstruction.X + 16;
                Y1 = actorConstruction.Y;
                Y2 = actorConstruction.Y + 16;

                _renderVector.X         = actorConstruction.X;
                _renderVector.Y         = actorConstruction.Y;
                _textureClipping.X      = _textureClipping.Y = 0;
                _textureClipping.Height = _textureClipping.Width = 16;

                TextureKey = TextureKey.Dungeon;
                ZSort      = ActorZSort.AlwaysOnBottom;

                break;

            case BasicActorConstructionType.DungeonBlock_03:
                Clipping = false;

                X1 = actorConstruction.X;
                X2 = actorConstruction.X + 16;
                Y1 = actorConstruction.Y;
                Y2 = actorConstruction.Y + 16;

                _renderVector.X         = actorConstruction.X;
                _renderVector.Y         = actorConstruction.Y;
                _textureClipping.X      = 16;
                _textureClipping.Y      = 0;
                _textureClipping.Height = 16;
                _textureClipping.Width  = 16;

                TextureKey = TextureKey.Dungeon;
                ZSort      = ActorZSort.AlwaysOnBottom;

                break;

            default:
                throw new ActorConstructionTypeNotImplementedException("BlockActor does not implement: " + actorConstruction.ActorConstructionType.ToString());
            }
        }
예제 #3
0
        protected override void Initialize()
        {
            ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.Dungeon);
            ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.Frizzy);
            ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.GameplayHud);
            ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.Slime);

            BasicActorConstruction blockConstruction = new BasicActorConstruction()
            {
                X = 32,
                Y = 32,
                ActorConstructionType = BasicActorConstructionType.DungeonBlock_01
            };
            var block = new BlockActor(blockConstruction);

            ActorManager.AddActor(block);

            blockConstruction.X = 48;
            block = new BlockActor(blockConstruction);
            ActorManager.AddActor(block);

            blockConstruction.Y = 16;
            block = new BlockActor(blockConstruction);
            ActorManager.AddActor(block);

            blockConstruction.X = 80;
            blockConstruction.Y = 32;
            block = new BlockActor(blockConstruction);
            ActorManager.AddActor(block);

            BasicActorConstruction otherBlockConstruction = new BasicActorConstruction()
            {
                X = 32,
                Y = 48,
                ActorConstructionType = BasicActorConstructionType.DungeonBlock_03
            };

            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.X = 48;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.X = 64;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.Y = 32;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.Y = 16;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.Y = 0;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.X = 48;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.X = 32;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.X = 16;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.Y = 16;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.Y = 32;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.Y = 48;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            otherBlockConstruction.X = 32;
            otherBlockConstruction.Y = 16;
            block = new BlockActor(otherBlockConstruction);
            ActorManager.AddActor(block);

            var player = new PlayerActor(ActorManager, ControllerManager);

            ActorManager.AddActor(player);

            MapManager.SetCameraFocus(player);
            MapManager.SetMapSize(200, 160);

            var slimeConstruction = new BasicActorConstruction
            {
                ActorConstructionType = BasicActorConstructionType.SlimeActive,
                X = 32,
                Y = 64
            };
            var slime = new SlimeActor(ActorManager, slimeConstruction);

            ActorManager.AddActor(slime);
        }