Beispiel #1
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------

        public BaseTileData()
        {
            name          = "";
            type          = null;
            tileset       = null;
            sheetLocation = Point2I.Zero;
            properties    = new Properties(this);
            events        = new ObjectEventCollection();

            properties.Set("id", "");
            properties.SetDocumentation("id", "ID", "", "", "General",
                                        "The id used to refer to this tile.");

            properties.Set("enabled", true);
            properties.SetDocumentation("enabled", "Enabled", "", "", "General",
                                        "True if the tile is spawned upon entering the room.");

            properties.Set("sprite_index", 0);
            properties.SetDocumentation("sprite_index", "Sprite Index", "sprite_index", "", "Internal",
                                        "The current sprite in the sprite list to draw.");

            properties.Set("substrip_index", 0);
            properties.SetDocumentation("substrip_index", "Animation Substrip Index", "", "", "Internal",
                                        "The index of the substrip for dynamic animations.", true, true);
        }
Beispiel #2
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------

        public Room(Level level, int x, int y, Zone zone = null)
        {
            this.level     = level;
            this.location  = new Point2I(x, y);
            this.tileData  = new TileDataInstance[level.RoomSize.X, level.RoomSize.Y, level.RoomLayerCount];
            this.eventData = new List <EventTileDataInstance>();
            //this.zone		= zone;
            this.events     = new ObjectEventCollection();
            this.properties = new Properties();
            this.properties.PropertyObject = this;
            this.properties.BaseProperties = new Properties();

            properties.BaseProperties.Set("id", "")
            .SetDocumentation("ID", "", "", "", "The id used to refer to this room.", true, false);
            properties.BaseProperties.Set("music", "")
            .SetDocumentation("Music", "song", "", "", "The music to play in this room. Select none to choose the default music.", true, false);
            properties.BaseProperties.Set("zone", "")
            .SetDocumentation("Zone", "zone", "", "", "The zone type for this room.", true, false);

            properties.BaseProperties.Set("discovered", false);
            properties.BaseProperties.Set("hidden_from_map", false);
            properties.BaseProperties.Set("boss_room", false);

            events.AddEvent("event_room_start", "Room Start", "Occurs when the room begins.");
            properties.BaseProperties.Set("event_room_start", "")
            .SetDocumentation("Room Start", "script", "", "Events", "Occurs when the room begins.");

            events.AddEvent("event_all_monsters_dead", "All Monsters Dead", "Occurs when all monsters are dead.");
            properties.BaseProperties.Set("event_all_monsters_dead", "")
            .SetDocumentation("All Monsters Dead", "script", "", "Events", "Occurs when all monsters are dead.");

            // Room Flags:
            // - sidescroll ??? could be in Zone
            // - underwater ??? could be in Zone
            // - discovered
            // - hiddenFromMap
            // - boss
            // - trasure
            // - signal

            /*if (zone != null)
             *      this.properties.Set("zone", zone.ID);*/
        }
Beispiel #3
0
        public override void Clone(BaseTileData copy)
        {
            base.Clone(copy);
            if (copy is TileData)
            {
                TileData copyTileData = (TileData)copy;
                //size				= copyTileData.size;
                spriteAsObject = new SpriteAnimation(copyTileData.spriteAsObject);
                breakAnimation = copyTileData.breakAnimation;
                breakSound     = copyTileData.breakSound;
                events         = new ObjectEventCollection(copyTileData.events);

                if (copyTileData.spriteList.Length > 0)
                {
                    spriteList = new SpriteAnimation[copyTileData.spriteList.Length];
                    for (int i = 0; i < spriteList.Length; i++)
                    {
                        spriteList[i] = new SpriteAnimation(copyTileData.spriteList[i]);
                    }
                }
            }
        }