示例#1
0
        public GameObject(Game1 game, GameObjectType type, String name, float size, Vector2 pos, float vel, bool draggable, int layer)
        {
            this.game = game;
            this.name = name;
            this.type = type;
            this.img = game.Content.Load<Texture2D>("Graphics\\" + name);
            this.size = size;
            this.pos = pos;
            this.vel = vel;
            this.draggable = draggable;
            this.layer = layer;

            touched = false;

            game.Add(this);
        }
示例#2
0
        protected Matrix transformation; // initial transformation

        #endregion Fields

        #region Constructors

        public GameObject(Game1 game, Vector3 pos)
        {
            this.game = game;

            Type = GameObjectType.None;

            HitPoints = 0;
            AttackSpeed = 0;
            Damage = 0;

            model = null;
            modelName = "";
            Scale = 1.0f;
            transformation = Matrix.Identity;
            color = Color.Transparent;
            isCollidable = true;
            isAlive = true;
            collisionState = CollisionState.None;
            attackCounter = 0;

            this.pos = pos;
            game.Add(this);
        }