List <Particle.Particles> ParticlesList = new List <Particle.Particles>(); //粒子序列 public BackGround(TextureManager _texturemanager, int level, Particle.Particles _p = null) { if (_p != null) { particles = _p; allowrunParticles = true; } this.level = level; renderer = Stage1State._renderer; this.texturemanager = _texturemanager; Texture texture = _texturemanager.Get("shade1"); background = new Sprite(); background.Texture = texture; background.SetPosition(0, 225); background.SetHeight(450); background.SetWidth(385 + 10); tree = new List <Tree>(); //添加一开始就有的树 for (int i = 0; i < 3; i++) { backgroundimage = new BackGroundImage(_texturemanager, renderer, "stg1bg", new Rectangle(0.01f, 0.01f, 0.48f, 0.48f), 385 + 10, 450); SpeedY = 0.05f; backgroundimage.SetPosition(0, 225); Tree tree1 = new Tree(texturemanager, renderer, "stg1bg", false, 200, 200); tree1.setTop(400); tree1.setPosition(16 + 30 * (float)random.NextDouble() - 15, i * 200 + 60 * (float)random.NextDouble() - 30); tree.Add(tree1); tree1 = new Tree(texturemanager, renderer, "stg1bg", true, 200, 200); tree1.setTop(400); tree1.setPosition(-100 + 30 * (float)random.NextDouble() - 15, i * 200 + 100 * (float)random.NextDouble() - 50); tree.Add(tree1); tree1 = new Tree(texturemanager, renderer, "stg1bg", true, 200, 200); tree1.setTop(400); tree1.setPosition(160 + 30 * (float)random.NextDouble() - 15, i * 200 + 60 * (float)random.NextDouble() - 30); tree.Add(tree1); } }
public BackGround(TextureManager _texturemanager, int level, Particle.Particles _p = null) { if (_p != null) { particles = _p; allowrunParticles = true; } this.level = level; renderer = Stage1State._renderer; this.texturemanager = _texturemanager; Texture texture = _texturemanager.Get("shade1"); background = new Sprite(); background.Texture = texture; background.SetPosition(0, 225); background.SetHeight(450); background.SetWidth(385+10); tree = new List<Tree>(); //添加一开始就有的树 for (int i = 0; i < 3; i++) { backgroundimage = new BackGroundImage(_texturemanager, renderer, "stg1bg", new Rectangle(0.01f, 0.01f, 0.48f, 0.48f), 385+10, 450); SpeedY = 0.05f; backgroundimage.SetPosition(0, 225); Tree tree1 = new Tree(texturemanager, renderer, "stg1bg", false, 200, 200); tree1.setTop(400); tree1.setPosition(16 + 30 * (float)random.NextDouble() - 15, i*200 + 60 * (float)random.NextDouble() - 30); tree.Add(tree1); tree1 = new Tree(texturemanager, renderer, "stg1bg", true, 200, 200); tree1.setTop(400); tree1.setPosition(-100 + 30 * (float)random.NextDouble() - 15, i * 200 + 100 * (float)random.NextDouble() - 50); tree.Add(tree1); tree1 = new Tree(texturemanager, renderer, "stg1bg", true, 200, 200); tree1.setTop(400); tree1.setPosition(160 + 30 * (float)random.NextDouble() - 15, i * 200 + 60 * (float)random.NextDouble() - 30); tree.Add(tree1); } }
public void BindParticle(Particle.Particles p) { ParticlesList.Add(p); }