public HealthPickup(Vector2 position, Tank tank) { player = tank; healthSprite.PreLoad(ref PreLoadedTextures.HealthPickupTexture); healthSprite.SetPosition(-healthSprite.Width * 1.5f, -healthSprite.Height / 2); AddChild(healthSprite); SetPosition(position.x, position.y); collider = new BoxCollider(position, healthSprite.Width * 2, healthSprite.Height, 0); }
public AmmoPickup(Vector2 position, Tank tank) { player = tank; ammo1.PreLoad(ref PreLoadedTextures.AmmoPickupTexture); ammo2.PreLoad(ref PreLoadedTextures.AmmoPickupTexture); ammo3.PreLoad(ref PreLoadedTextures.AmmoPickupTexture); ammo1.SetPosition(-ammo1.Width * 1.5f, -ammo1.Height / 2); ammo2.SetPosition(-ammo2.Width / 2, -ammo2.Height / 2); ammo3.SetPosition(ammo2.Width / 2, -ammo3.Height / 2); AddChild(ammo1); AddChild(ammo2); AddChild(ammo3); SetPosition(position.x, position.y); collider = new BoxCollider(position, ammo1.Width * 2, ammo1.Height, 0); }