예제 #1
0
        protected byte LeakPercent;     // The percentage of gas on the tile that will be leaked into space. Behind the scenes, the gas is deleted.



        /// <summary>
        /// Does things relating to turfs, make sure this is called last in your Initalise() method.
        /// </summary>
        protected void InitaliseTurf()
        {
            IsDragable    = false; // Sets all the properties tipical of a floor.
            IsPassable    = true;
            IsTransparent = true;

            OtherProperties.Add("flat");        // Some of the things a turf would normally be.
            OtherProperties.Add("footheight");

            InitaliseBace();   // Initalises the bace class.

            // TODO: Set up nesasary code to simulate an atmosphere.
        }
예제 #2
0
        /// <summary>
        /// Initalsies the tile, always run this, or this tile wont exist.
        /// </summary>
        public void Initalise()
        {
            LeakPercent = 100;                      // It is space, so it leaks 100% of the air there.
            Seed        = ObjectName.GetHashCode(); // This will get a random seed that isn't dependant on the system time as much since it is dependant on 1 centeral RNG (Right now. This will change.)
            Random Random = new Random(Seed);

            SpriteNumber       = Random.Next(NumberOfSprites);      // Choses what icon is used for this tile.
            SpriteState.Sprite = "Space" + SpriteNumber.ToString(); // Sets the sprite to that icon.
            ContentLoader.AddTexture("Space" + SpriteNumber, "Objects/Turf/Space/" + SpriteNumber);
            ZeroToThree          = Random.Next(4);
            SpriteState.Rotation = ZeroToThree * (float)1.57079633; // Creates 4 varations of each sprite by rotating them, reducing common patterns.


            OtherProperties.Remove("footheight");
            OtherProperties.Add("lackofobject");        // lackofobject means that the object in question is more of the lack of an object than an object itself.


            InitaliseTurf();  // Does things relating to turfs. Like makes you able to walk on them and see through them.
        }