Beispiel #1
0
        public Block(Game1 game, Vector2 position, string texture, bool hasPhysics)
            : base(game)
        {
            blockTexture = game.Content.Load<Texture2D>(texture);
            this.hasPhysics = hasPhysics;

            if (hasPhysics) {
                CreatePhysicsBody();
            }
            this.Position = position;

            blockInfo = new BlockInfo() {
                Texture = texture,
                HasPhysics = hasPhysics
            };
        }
Beispiel #2
0
        public void Load(GameObjectInfo info)
        {
            this.hasPhysics = info.GetProperty<bool>("HasPhysics");

            if (hasPhysics) {
                CreatePhysicsBody();
            }

            Position = info.GetProperty<Vector2>("Position");
            this.blockTexture = Game.Content.Load<Texture2D>(info.GetProperty<string>("Texture"));
            blockInfo = new BlockInfo() {
                Texture = info.GetProperty<string>("Texture"),
                HasPhysics = hasPhysics
            };
        }