Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public FormGame()
- {
- InitializeComponent();
- StreamReader sr = new StreamReader("nivel1.txt");
- while (!sr.EndOfStream)
- {
- tbGame.Text += sr.ReadToEnd();
- }
- sr.Close();
- loadMap2();
- loadMap();
- sr.Close();
- }
- public void loadPlayers()
- {
- map[x, y] = '!'; //Player 2,2
- map[x, y] = 'X'; //Monster1Lvl1 5,2
- map[x, y] = 'X'; //Monster2Lvl1 14,10
- map[x, y] = 'X'; //Monster3Lvl1 30,18
- }
- public void loadMap()
- {
- tbGame.Text = "";
- for (int i = 0; i < 44; i++)
- {
- for (int j = 0; j < 20; j++)
- {
- tbGame.Text += map [i, j];
- }
- tbGame.Text += "\r\n";
- }
- }
- public void loadMap2()
- {
- for (int i = 0; i < 44; i++)
- {
- for (int j = 0; j < 20; j++)
- {
- map[i, j] = ' ';
- }
- }
- }
- if (e.KeyCode == Keys.Space || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.Left || e.KeyCode == Keys.Right)
- {
- if (e.KeyCode == Keys.Up)
- {
- //Aqui le doy la posicion inicial al Jugador y despues dependiendo de la tecla se movieria
- int x = 2;
- int y = 2;
- map[x, y] = ' ';
- y += 1;
- map[x, y] = '!';
- loadMap();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement