public override void LoadContent(ContentManager content, InputManager inputmanager) { moveSpeed = 300f; moveAnimation = new SpriteSheetAnimation(); base.LoadContent(content, inputmanager); fileManager = new FileManager(); //make paddle fileManager.LoadContent("Load/Paddle.txt", attributes, contents); for (int i = 0; i < attributes.Count; i++) { for (int j = 0; j < attributes[i].Count; j++) { switch (attributes[i][j]) { case "Image": image = this.content.Load <Texture2D>(contents[i][j]); break; case "Position": string[] frames = contents[i][j].Split(' '); position = new Vector2(int.Parse(frames[0]), int.Parse(frames[1])); break; } } } moveAnimation.LoadContent(content, image, "", null, position); }
public override void LoadContent(ContentManager content, InputManager inputmanager) { moveAnimation = new SpriteSheetAnimation(); //moveAnimation.Frames = new Vector2(0, 0); base.LoadContent(content, inputmanager); fileManager = new FileManager(); //load image fileManager.LoadContent("Load/Ball.txt", attributes, contents); for (int i = 0; i < attributes.Count; i++) { for (int j = 0; j < attributes[i].Count; j++) { switch (attributes[i][j]) { case "Image": image = this.content.Load <Texture2D>(contents[i][j]); break; case "Position": string[] frames = contents[i][j].Split(' '); position = new Vector2(int.Parse(frames[0]), int.Parse(frames[1])); break; //case for individual Frames per object case "Frames": string[] frms = contents[i][j].Split(','); moveAnimation.Frames = new Vector2(int.Parse(frms[0]), int.Parse(frms[1])); break; } } } moveAnimation.LoadContent(content, image, "", null, position); maxX = ScreenManager.Instance.Dimensions.X - image.Width; maxY = ScreenManager.Instance.Dimensions.Y - image.Height; moveSpeed = 150f; Speed = new Vector2(moveSpeed, moveSpeed); Position = Vector2.Zero; }
public override void LoadContent(ContentManager content, InputManager inputmanager) { base.LoadContent(content, inputmanager); fileManager = new FileManager(); moveAnimation = new SpriteSheetAnimation(); string[] tempFrames = null; moveSpeed = 100f; fileManager.LoadContent("Load/Player.txt", attributes, contents); for (int i = 0; i < attributes.Count; i++) { for (int j = 0; j < attributes[i].Count; j++) { switch (attributes[i][j]) { case "Health": health = int.Parse(contents[i][j]); break; case "Frames": tempFrames = contents[i][j].Split(' '); //moveAnimation.Frames = new Vector2(int.Parse(tempFrames[0]), int.Parse(tempFrames[1])); break; case "Image": image = this.content.Load <Texture2D>(contents[i][j]); break; case "Position": string[] posit = contents[i][j].Split(' '); position = new Vector2(int.Parse(posit[0]), int.Parse(posit[1])); break; } } } moveAnimation.LoadContent(content, image, "", null, position); moveAnimation.Frames = new Vector2(int.Parse(tempFrames[0]), int.Parse(tempFrames[1])); }
public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content, InputManager inputmanager) { base.LoadContent(content, inputmanager); moveSpeed = 60f; tracker = 0; //map = new Map(); fileManager = new FileManager(); moveAnimation = new SpriteSheetAnimation(); Vector2 tempFrames = Vector2.Zero; SolutionPathList = new ArrayList(); Steps = new List <ArrayList>(); n = 0; B = new Node(null, null, 1, 5, 5); C = new Node(null, null, 1, 30, 5); D = new Node(null, null, 1, 35, 32); A = new Node(null, null, 1, 5, 35); notes = new Node[6]; notes[0] = A; notes[1] = B; notes[2] = C; notes[3] = D; notes[4] = A; Waypoint(A, B); location = new Node(); goal = new Node(); fileManager.LoadContent("Load/Bot.txt", attributes, contents); for (int i = 0; i < attributes.Count; i++) { for (int j = 0; j < attributes[i].Count; j++) { switch (attributes[i][j]) { case "Health": health = int.Parse(contents[i][j]); break; case "Frames": string[] frames = contents[i][j].Split(' '); tempFrames = new Vector2(int.Parse(frames[0]), int.Parse(frames[1])); break; case "Image": image = this.content.Load <Texture2D>(contents[i][j]); break; case "Position": frames = contents[i][j].Split(' '); position = new Vector2(int.Parse(frames[0]), int.Parse(frames[1])); break; } } } moveAnimation.LoadContent(content, image, "", null, position); moveAnimation.Frames = tempFrames; moveAnimation.CurrentFrame = new Vector2(0, 0); location = (Node)Steps[n][tracker]; goal = (Node)Steps[n][tracker + 1]; }