public void LoadContent() { image = game.Content.Load<Texture2D>(@"Images/Enemies/vortex"); collisionBox.Width = (image.Width / imageSize.X) - (collisionBoxReduction.X * 2); collisionBox.Height = (image.Height / imageSize.Y) - (collisionBoxReduction.Y * 2); objectManager = (ObjectManager)game.Services.GetService(typeof(ObjectManager)); }
public Star(Game baseGame, Vector2 position, SpriteBatch spriteBatchToUse) : base(position) { spriteBatch = spriteBatchToUse; game = baseGame; starArt = game.Content.Load<Texture2D>(@"Collectibles/Level1/star"); collisionBox = new Rectangle((int) position.X, (int) position.Y, 50, 50); if (omReference == null) { omReference = (ObjectManager)game.Services.GetService(typeof(ObjectManager)); } }
public Bouncing() { clearColor = new Color(22,22,22); graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; Content.RootDirectory = "Content"; screenSystem = new ScreenSystem(this); Components.Add(screenSystem); objectManager = new ObjectManager(this); collisionDetectionService = new CollisionDetectionCircleService(this); _input = new InputManager(this); Services.AddService(typeof(ObjectManager), objectManager); Services.AddService(typeof(IManageCollisionsService), collisionDetectionService); Services.AddService(typeof(IInputService), _input); }
public override void Initialize() { starsCollected = 1; levelManager = new LevelManager(); levelManager.Init(ScreenSystem.Game, ScreenSystem.SpriteBatch); if (level == 0) { curLevel = levelManager.NextLevel(); } else { curLevel = levelManager.GetLevel(level); } //Inits the audio switch (level) { case 1: audioManager = new AudioManager("spacetheme"); break; case 2: audioManager = new AudioManager("spacetheme"); break; case 3: audioManager = new AudioManager("lavatheme"); break; } audioManager.LoadContent(); objectManager = (ObjectManager)ScreenSystem.Game.Services.GetService((typeof(ObjectManager))); collisionManager = (IManageCollisionsService)ScreenSystem.Game.Services.GetService((typeof(IManageCollisionsService))); _input = (InputManager)ScreenSystem.Game.Services.GetService(typeof(IInputService)); input = ScreenSystem.InputSystem; input.NewAction("Pause", Keys.Escape); screenOverlayManager = new ScreenOverlayManager(ScreenSystem.Game, this); ScreenSystem.Game.Components.Add(screenOverlayManager); Entering += new TransitionEventHandler(PlayScreen_Entering); }
public void LoadContent() { soundEffect = game.Content.Load<SoundEffect>(@"Audio/Sounds/star"); soundeffectinstance = soundEffect.CreateInstance(); image = game.Content.Load<Texture2D>(@"Images/Player/blob"); collisionBox.Width = 100; collisionBox.Height = 100; objectManager = (ObjectManager) game.Services.GetService(typeof (ObjectManager)); collisionManager = (IManageCollisionsService) game.Services.GetService((typeof (IManageCollisionsService))); _input = (IInputService) game.Services.GetService(typeof (IInputService)); }