Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Audio;
- using Microsoft.Xna.Framework.Content;
- using Microsoft.Xna.Framework.GamerServices;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Input;
- using Microsoft.Xna.Framework.Media;
- using Microsoft.Xna.Framework.Net;
- using Microsoft.Xna.Framework.Storage;
- using System.IO;
- namespace Platformer
- {
- public class Level
- {
- //Content
- private int[] x = new int[100 * 16];
- private int[] y = new int[100 * 16];
- StreamReader stream;
- Tank pl1;
- Tank pl2;
- public Level(StreamReader fajl, ref Tank p1, ref Tank p2)
- {
- stream = fajl;
- pl1 = p1;
- pl2 = p2;
- init();
- }
- public void init()
- {
- int i = 0;
- while (!stream.EndOfStream)
- {
- string sor = stream.ReadLine();
- string[] splitelt = sor.Split(',');
- if (i <= 1)
- {
- if (i == 0)
- pl1.SetPos(new Vector2(Convert.ToInt32(splitelt[0]), Convert.ToInt32(splitelt[1])));
- if (i == 1)
- pl2.SetPos(new Vector2(Convert.ToInt32(splitelt[0]), Convert.ToInt32(splitelt[1])));
- }
- else
- {
- x[i] = Convert.ToInt32(splitelt[0]);
- y[i] = Convert.ToInt32(splitelt[1]);
- }
- i += 1;
- }
- }
- public int[] GetContentX()
- {
- return x;
- }
- public int[] GetContentY()
- {
- return y;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement