public bImage checkWhosLast(bImage one,bImage two,bImage three) { if (one.position.X > two.position.X) { if (three.position.X > one.position.X) { return three; } else { return one; } } else { if (three.position.X > two.position.X) { return three; } else { return two; } } }
public void initImage(ContentManager Content) { sound = Content.Load<SoundEffect>("Sounds/NewArea").CreateInstance(); b[0] = new bImage(Content.Load<Texture2D>("Sprites/one"), new Vector2(0, 0)); b[1] = new bImage(Content.Load<Texture2D>("Sprites/two"), new Vector2(0, 0)); b[2] = new bImage(Content.Load<Texture2D>("Sprites/three"), new Vector2(0, 0)); b[3] = new bImage(Content.Load<Texture2D>("Sprites/four"), new Vector2(0, 0)); b[4] = new bImage(Content.Load<Texture2D>("Sprites/five"), new Vector2(0, 0)); b[5] = new bImage(Content.Load<Texture2D>("Sprites/six"), new Vector2(0, 0)); b[6] = new bImage(Content.Load<Texture2D>("Sprites/seven"), new Vector2(0, 0)); b[7] = new bImage(Content.Load<Texture2D>("Sprites/eight"), new Vector2(0, 0)); b[8] = new bImage(Content.Load<Texture2D>("Sprites/nine"), new Vector2(0, 0)); b[9] = new bImage(Content.Load<Texture2D>("Sprites/ten"), new Vector2(0, 0)); b[10] = new bImage(Content.Load<Texture2D>("Sprites/eleven"), new Vector2(0, 0)); b[11] = new bImage(Content.Load<Texture2D>("Sprites/twelve"), new Vector2(0, 0)); b[12] = new bImage(Content.Load<Texture2D>("Sprites/thirteen"), new Vector2(0, 0)); b[0].position.X=0; b[1].position.X=b[0].position.X+b[0].image.Width; b[2].position.X = b[1].position.X + b[1].image.Width; b[3].position.X = b[2].position.X + b[2].image.Width; b[4].position.X = b[3].position.X + b[3].image.Width; b[5].position.X = b[4].position.X + b[4].image.Width; b[6].position.X = b[5].position.X + b[5].image.Width; b[7].position.X = b[6].position.X + b[6].image.Width; b[8].position.X = b[7].position.X + b[7].image.Width; b[9].position.X = b[8].position.X + b[8].image.Width; b[10].position.X = b[9].position.X + b[9].image.Width; b[11].position.X = b[10].position.X + b[10].image.Width; b[12].position.X = b[11].position.X + b[11].image.Width; }
public void kill(bImage one, bImage two, bImage three) { if (one.position.X < -one.image.Width && one.draw==true) { one.position.X = -one.image.Width; one.draw = false; // one.image.Dispose(); } if (two.position.X < -one.image.Width&& two.draw == true) { two.position.X = -one.image.Width; two.draw = false; // two.image.Dispose(); } if (three.position.X < -one.image.Width&& three.draw == true) { three.position.X = -one.image.Width; three.draw = false; //three.image.Dispose(); } one.update(); two.update(); three.update(); }
public void loop(bImage one, bImage two, bImage three) { if (one.position.X < (-one.image.Width) ) { one.position.X = checkWhosLast(one, two, three).position.X + one.image.Width; } if (two.position.X < (-two.image.Width)) { two.position.X = checkWhosLast(one, two, three).position.X + two.image.Width; } if (three.position.X < (-three.image.Width)) { three.position.X = checkWhosLast(one, two, three).position.X +three.image.Width; } }