示例#1
0
文件: Entity.cs 项目: jtrain184/mgp18
        // shortened constructor (used for Entities such as E_Space:
        public Entity(State parentState, Vector2 pos)
        {
            this.parentState  = parentState;
            this.pos          = pos;
            this.id           = EntityCounter.takeNumber();
            this.sprite       = parentState.parentManager.game.noSprite; // default sprite
            this.spriteWidth  = sprite.Width;
            this.spriteHeight = sprite.Height;

            // Default values:
            this.active  = true;
            this.visible = true;
        }
示例#2
0
文件: Entity.cs 项目: jtrain184/mgp18
        // constructor:
        public Entity(State parentState, Texture2D sprite, int x, int y)
        {
            this.parentState  = parentState;
            this.pos.X        = x;
            this.pos.Y        = y;
            this.id           = EntityCounter.takeNumber();
            this.sprite       = sprite;
            this.spriteWidth  = sprite.Width;
            this.spriteHeight = sprite.Height;

            // Default values:
            this.active  = true;
            this.visible = true;
        }