Exemplo n.º 1
0
        /// <summary>
        /// create a ball Spritelet that can be scaled
        /// </summary>
        /// <param name="radius">the relative size scaling, 1 is normal</param>
        /// <returns></returns>
        public Entity CreateBall(double radius)
        {
            Entity e = TTFactory.CreateSpritelet("paul-hardman_circle-four");

            e.AddComponent(new ScaleComp(radius));
            return(e);
        }
Exemplo n.º 2
0
        /// <summary>
        /// create a ball Spritelet that can be scaled
        /// </summary>
        /// <param name="radius">the relative size scaling, 1 is normal</param>
        /// <returns></returns>
        public Entity CreateBall(double radius)
        {
            Entity e = TTFactory.CreateSpritelet(this.BallSprite);

            e.AddComponent(new ScaleComp(radius));
            return(e);
        }
Exemplo n.º 3
0
        public static Entity CreateThing(ThingType tp, bool hasControls, string bitmap)
        {
            var e  = TTFactory.CreateSpritelet(bitmap);
            var sc = e.GetComponent <SpriteComp>();
            var tc = new ThingComp(tp, Level.Current.Background, sc.Texture);

            e.AddComponent(tc);
            if (hasControls)
            {
                var tcc = new ThingControlComp();
                e.AddComponent(tcc);
            }
            tc.PassableIntensityThreshold = Level.Current.DefaultPassableIntensityThreshold;
            var textureData = new Color[tc.BoundingRectangle.Width * tc.BoundingRectangle.Height];

            sc.Texture.GetData(textureData);
            sc.Center = Vector3.Zero;

            return(e);
        }