Ejemplo n.º 1
0
 public Entity(MyGame _main) : base(_main)
 {
     main   = _main;
     sprite = main.Services.GetService(typeof(TextureAsset)) as TextureAsset;
     main.Components.Add(this);
     spriteBatch = main.Services.GetService(typeof(SpriteBatch)) as SpriteBatch;
 }
Ejemplo n.º 2
0
 protected override void Initialize()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     Services.AddService(typeof(SpriteBatch), spriteBatch);
     GameInput = new GameInput();
     GameInput.Load(this);
     Services.AddService(typeof(GameInput), GameInput);
     sprite = new TextureAsset(Content);
     Services.AddService(typeof(TextureAsset), sprite);
     collision = new Collision();
     Services.AddService(typeof(Collision), collision);
     utility = new Utility(this);
     Services.AddService(typeof(Utility), utility);
     menu = new Menu(this);
     base.Initialize();
 }