public override void LoadContent() { spriteBatch = new SpriteBatch(Game.GraphicsDevice); factory = new CometsGameObjectFactory(Game, SceneManager); SetMockTextures(); SceneManager.AddSystem(new SpriteSystem(spriteBatch)); SceneManager.AddSystem(new DebugDrawSystem(spriteBatch)); var collisionSystem = new CollisionSystem(); collisionSystem.Collision += OnCollision; SceneManager.AddSystem(collisionSystem); particles = new ParticleEmittersSystem(spriteBatch, collisionSystem); SceneManager.AddSystem(particles); SceneManager.AddSystem(new KeyboardMovementSystem()); SceneManager.AddSystem(new RotationSystem()); SceneManager.AddSystem(new GravitationSystem() { Gravitation = 600f, MaxFallSpeed = 600f }); factory.CreateBackground(); factory.CreatePaddle(); bloodLevel = new BloodLevel(Game, 2.0f); SceneManager.GameObjects.Extend<CollisionComponent, DebugCollisionComponent>(); base.LoadContent(); }
public ParticleEmittersSystem(SpriteBatch spriteBatch, CollisionSystem collisionSystem) { particles = new List<Particle>(); random = new Random(); this.spriteBatch = spriteBatch; collisionSystem.Collision += new EventHandler<CollisionEventArgs>(collisionSystem_Collision); }
public ParticleEmittersSystem(SpriteBatch spriteBatch, CollisionSystem collisionSystem) { particles = new List <Particle>(); random = new Random(); this.spriteBatch = spriteBatch; collisionSystem.Collision += new EventHandler <CollisionEventArgs>(collisionSystem_Collision); }