/// <summary> /// Initialize the level. /// </summary> /// <param name="name">The name of the level.</param> /// <param name="camera">The camera that will display the level.</param> public void Initialize(string name, Camera2D camera) { //Initialize some variables. _Name = name; _Layers = new RobustList<Layer>(); _IsVisible = true; _Camera = camera; _GraphicsDevice = null; _ContentManager = null; _World = new World(new Vector2(0, 10)); _State = LevelState.Play; }
/// <summary> /// Initialize the manager. /// </summary> private void Initialize() { //Initialize variables. _Sprites = new RobustList<Sprite>(); }
/// <summary> /// Initialize the GUI. /// </summary> private void Initialize() { //Initialize some variables. _Items = new RobustList<Component>(); _FocusQueue = new List<Component>(); _ForegroundItems = new RobustList<Component>(); _IsActive = true; _IsVisible = true; _RightClickList = new List(this, Vector2.Zero, 100, 200); _HasRightClicked = false; _IsContentLoaded = false; //Play with the right click list. _RightClickList.AddItem(); _RightClickList.AddItem(); _RightClickList.AddItem(); (_RightClickList.Items[0] as LabelListItem).Label.Text = "Item1"; (_RightClickList.Items[1] as LabelListItem).Label.Text = "Item2"; (_RightClickList.Items[2] as LabelListItem).Label.Text = "Item3"; }
/// <summary> /// Initialize the layer. /// </summary> /// <param name="level">The level in which this layer resides.</param> /// <param name="name">The name of this layer.</param> /// <param name="scrollSpeed">The scrolling speed of this layer. Used for parallex scrolling.</param> public void Initialize(Level level, string name, Vector2 scrollSpeed) { //Initialize some variables. _Level = level; _Name = name; _Items = new RobustList<Item>(); _IsVisible = true; _ScrollSpeed = scrollSpeed; _CameraMatrix = Matrix.Identity; //Manage all items, ie. add and remove them from the layer. ManageItems(); }
/// <summary> /// Initialize the physics simulator. /// </summary> private void Initialize() { // Initialize some variables. _Bodies = new RobustList<Body>(); _Forces = new RobustList<Force>(); _Gravity = 0.3f; _EnergyDecrease = 0.05f; }