public static Piece GetRandom(Random rnd, string type) { //Roll to generate a random enemy that is different from the previous generated enemy Piece piece = null; //Roll var roll = rnd.Next(0, m_PrefabList.Count - 1); //Add pickup here for each roll //roll = 0; piece = PiecePrefabList.GetPrefab((Collision)roll, type); return(piece); }
public override void Initialize(RenderContext context) { Piece side = PiecePrefabList.GetPrefab(Collision.Col2, "Side"); side.Rotate(0, 0, -90); side.Translate(-200, 750); side.Scale(1f, 1, 1); AddChild(side); Piece ground = PiecePrefabList.GetPrefab(Collision.Col5, "Ground"); ground.Translate(-200, ground.Position.Y); AddChild(ground); //lots of volcanos at the begining of the level for (int i = 0; i < 1; ++i) { AddVolcano(ground.Height, ground.Position.Y, context); } Width = (int)ground.Width * 0.85f; }