public static void addDebris(Texture2D tex,Vector2 position,float angle,debrisType type,byte alpha) { //try if(world.levels[world.i_currentLvl].debris_current != null && world.levels[world.i_currentLvl].debris_current.Length > 0) { debris[] old = world.levels[world.i_currentLvl].debris_current; world.levels[world.i_currentLvl].debris_current = new debris[old.Length + 1]; for (int i = 0; i != old.Length; i++) { world.levels[world.i_currentLvl].debris_current[i] = old[i]; } world.levels[world.i_currentLvl].debris_current[old.Length] = new debris(position, tex, new Color(255, 255, 255, alpha), type); world.levels[world.i_currentLvl].debris_current[old.Length].angle = angle; } else { world.levels[world.i_currentLvl].debris_current = new debris[1]; world.levels[world.i_currentLvl].debris_current[0] = new debris(position, tex, new Color(255, 255, 255, alpha), type); world.levels[world.i_currentLvl].debris_current[0].angle = angle; } }
public debris(Vector2 pos, Texture2D tex, Color col, debrisType Type) { position = pos; texture = tex; color = col; type = Type; angle = 0; }